Class: MPD::Commands::CurrentPlaylistAdd

Inherits:
Abstract
  • Object
show all
Defined in:
lib/mpd/commands/current_playlist_add.rb

Overview

Adds song(s) to current playlist `songs` is an array of URIs.

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(songs) ⇒ Object

`songs` is position (as int) or range


13
14
15
16
# File 'lib/mpd/commands/current_playlist_add.rb', line 13

def execute(songs)
  return exec_command("add \"#{songs}\"") unless songs.is_a?(Array)
  exec_command_list(songs.map { |s| "add \"#{s}\"" })
end