From 602cbf21d35ba898841cac0f3c458bd90b6b6841 Mon Sep 17 00:00:00 2001 From: David Vazgenovich Shakaryan Date: Sun, 6 Jul 2014 16:09:47 -0700 Subject: Style changes and simpler code. --- libmpd/playlist.rb | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'libmpd/playlist.rb') diff --git a/libmpd/playlist.rb b/libmpd/playlist.rb index cc5db9f..d4be0b8 100644 --- a/libmpd/playlist.rb +++ b/libmpd/playlist.rb @@ -1,7 +1,7 @@ #!/usr/bin/env ruby # #-- -# Copyright 2009 David Vazgenovich Shakaryan +# Copyright 2009-2014 David Vazgenovich Shakaryan # Distributed under the terms of the GNU General Public License v3. # See http://www.gnu.org/licenses/gpl.txt for the full license text. #++ @@ -14,46 +14,46 @@ module MPDPlaylist # Adds the specified file to the playlist. # Directories add recursively. def add(uri) - return send_request('add "%s"' % uri) + send_request('add "%s"' % uri) end # Adds the specified file to the playlist and returns the song id. # An optional playlist position can be specified. - def addid(uri, position=nil) + def addid(uri, position = nil) command = 'addid "%s"' % uri command << ' %s' % position if position - return send_request(command).scan(/\d+/).first.to_i + send_request(command).scan(/\d+/).first.to_i end # Clears the playlist. def clear - return send_request('clear') + send_request('clear') end # Deletes a song from the playlist. def delete(songpos) - return send_request('delete %s' % songpos) + send_request('delete %s' % songpos) end # Deletes a song from the playlist. def deleteid(songid) - return send_request('deleteid %s' % songid) + send_request('deleteid %s' % songid) end # Returns an Array composed of Hashes containing information about the songs # in the playlist. def playlist - return split_and_hash(send_request('playlistinfo')) + split_and_hash(send_request('playlistinfo')) end # Swaps the positions of the given songs, specified by playlist positions. - def swap first, second - return send_request('swap %s %s' % [first, second]) + def swap(first, second) + send_request('swap %s %s' % [first, second]) end # Swaps the positions of the given songs, specified by song ids. - def swapid first, second - return send_request('swapid %s %s' % [first, second]) + def swapid(first, second) + send_request('swapid %s %s' % [first, second]) end end -- cgit v1.2.3-70-g09d2