summaryrefslogtreecommitdiff
path: root/libmpd/database.rb
diff options
context:
space:
mode:
authorDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2009-07-23 23:00:56 -0700
committerDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2009-07-23 23:00:56 -0700
commit34a8e8b5048ca530addc781bfb96721bd23e9704 (patch)
tree5a24b4d677a287fdf45cf0c44ce39d813fefe161 /libmpd/database.rb
parentac1c462f3ced63ff988c52ec14cbd7105d237a3e (diff)
downloadruby-libmpd-34a8e8b5048ca530addc781bfb96721bd23e9704.tar.gz
ruby-libmpd-34a8e8b5048ca530addc781bfb96721bd23e9704.tar.xz
The final new file for the time-being.
Diffstat (limited to 'libmpd/database.rb')
-rw-r--r--libmpd/database.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/libmpd/database.rb b/libmpd/database.rb
new file mode 100644
index 0000000..a1a6660
--- /dev/null
+++ b/libmpd/database.rb
@@ -0,0 +1,17 @@
+#!/usr/bin/env ruby
+#
+# Copyright 2009 David Vazgenovich Shakaryan <dvshakaryan@gmail.com>
+# Distributed under the terms of the GNU General Public License v3.
+# See http://www.gnu.org/licenses/gpl.txt for the full license text.
+
+module MPDDatabase
+ # Find all songs in database with an exact match.
+ def find type, what
+ return split_and_hash send_request 'find %s "%s"' % [type, what]
+ end
+
+ # Searches the database.
+ def search type, what
+ return split_and_hash send_request 'search %s "%s"' % [type, what]
+ end
+end