diff options
author | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2009-07-21 15:43:05 -0700 |
---|---|---|
committer | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2009-07-21 15:43:05 -0700 |
commit | 36d8e7b37af77beb9718dbf292425085c29b83ca (patch) | |
tree | b1987fec67f79ff782ef1766ba10a01b30d8691b /mpdlib.rb | |
parent | 17daf095bb67798cfd45494a427973b2bcc9bc35 (diff) | |
download | ruby-libmpd-36d8e7b37af77beb9718dbf292425085c29b83ca.tar.gz ruby-libmpd-36d8e7b37af77beb9718dbf292425085c29b83ca.tar.xz |
Add status and stats methods.
Diffstat (limited to 'mpdlib.rb')
-rw-r--r-- | mpdlib.rb | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -48,4 +48,28 @@ class MPD return hash end + + def status + response = send_request('status') + hash = Hash.new + + response.split("\n").each do |line| + field, value = line.split(': ') + hash[field] = value + end + + return hash + end + + def stats + response = send_request('stats') + hash = Hash.new + + response.split("\n").each do |line| + field, value = line.split(': ') + hash[field] = value + end + + return hash + end end |