Class: MPD::Commands::CurrentPlaylistRemove

Inherits:
Abstract
  • Object
show all
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

#connection

Instance Method Summary collapse

Methods inherited from Abstract

#initialize

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

Raises:

  • (ArgumentError)

14
15
16
17
# File 'lib/mpd/commands/current_playlist_remove.rb', line 14

def execute(position: nil, id: nil)
  raise(ArgumentError) if position && id || !position && !id
  exec_command(id ? "deleteid #{id}" : "delete #{resolve_range(position)}")
end