summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2009-07-23 19:39:09 -0700
committerDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2009-07-23 19:39:09 -0700
commit5fb83d8dd3f2e8be091194f3c34eab62df04da33 (patch)
treee36272a81e20f3a65cfd130a95ac59efe8ddc322
parentcff0409822f20022d82280f2f50305c4b4ebce85 (diff)
downloadruby-libmpd-5fb83d8dd3f2e8be091194f3c34eab62df04da33.tar.gz
ruby-libmpd-5fb83d8dd3f2e8be091194f3c34eab62df04da33.tar.xz
Add methods: consume?, random?, repeat?, single?.
-rw-r--r--libmpd.rb28
1 files changed, 28 insertions, 0 deletions
diff --git a/libmpd.rb b/libmpd.rb
index 48f999c..eaa90fb 100644
--- a/libmpd.rb
+++ b/libmpd.rb
@@ -237,6 +237,34 @@ class MPD
return false
end
+ # Returns +true+ if consume is activated.
+ # Otherwise, returns +false+.
+ def consume?
+ return true if status[:consume] == '1'
+ return false
+ end
+
+ # Returns +true+ if random is activated.
+ # Otherwise, returns +false+.
+ def random?
+ return true if status[:random] == '1'
+ return false
+ end
+
+ # Returns +true+ if repeat is activated.
+ # Otherwise, returns +false+.
+ def repeat?
+ return true if status[:repeat] == '1'
+ return false
+ end
+
+ # Returns +true+ if single is activated.
+ # Otherwise, returns +false+.
+ def single?
+ return true if status[:single] == '1'
+ return false
+ end
+
private :generate_hash
private :get_response
private :split_and_hash