Class: MPD::Commands::CurrentPlaylistRemove
- Defined in:
- lib/mpd/commands/current_playlist_remove.rb
Overview
Removes songs from current playlist by id or position/range
Instance Attribute Summary
Attributes inherited from Abstract
Instance Method Summary collapse
-
#execute(position: nil, id: nil) ⇒ Object
‘position` is int or range `id` is int song id.
Methods inherited from Abstract
Constructor Details
This class inherits a constructor from MPD::Commands::Abstract
Instance Method Details
#execute(position: nil, id: nil) ⇒ Object
‘position` is int or range `id` is int song id
14 15 16 17 18 |
# File 'lib/mpd/commands/current_playlist_remove.rb', line 14 def execute(position: nil, id: nil) raise(ArgumentError) if position && id || !position && !id command = id ? "deleteid #{id}" : "delete #{resolve_range(position)}" exec_command(command) end |