From 5fb83d8dd3f2e8be091194f3c34eab62df04da33 Mon Sep 17 00:00:00 2001 From: David Vazgenovich Shakaryan Date: Thu, 23 Jul 2009 19:39:09 -0700 Subject: Add methods: consume?, random?, repeat?, single?. --- libmpd.rb | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) 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 -- cgit v1.2.3-70-g09d2