Class: MPD::Commands::PlaylistAdd
- Defined in:
- lib/mpd/commands/playlist_add.rb
Overview
Adds song(s) to specific playlist.
Instance Attribute Summary
Attributes inherited from Abstract
Instance Method Summary collapse
Methods inherited from Abstract
Constructor Details
This class inherits a constructor from MPD::Commands::Abstract
Instance Method Details
#execute(name, songs) ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/mpd/commands/playlist_add.rb', line 13 def execute(name, songs) if songs.is_a?(Array) commands = songs.map { |s| "playlistadd \"#{name}\" \"#{s}\"" } exec_command_list(commands) else exec_command("playlistadd \"#{name}\" \"#{songs}\"") end end |