Class: Squeezer::Models::Playlist
- Defined in:
- lib/squeezer/models/playlist.rb
Overview
initial playlist support
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Instance Method Summary collapse
- #add(entity) ⇒ Object
- #clear ⇒ Object
-
#initialize(id, options = {}) ⇒ Playlist
constructor
A new instance of Playlist.
-
#load(entity) ⇒ Object
starts playing directly.
Methods inherited from Model
Methods included from Connection
close_connection, exec, #exit, open_connection, retrieve_connection
Constructor Details
#initialize(id, options = {}) ⇒ Playlist
Returns a new instance of Playlist.
9 10 11 12 |
# File 'lib/squeezer/models/playlist.rb', line 9 def initialize(id, ={}) super @id = id end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
7 8 9 |
# File 'lib/squeezer/models/playlist.rb', line 7 def id @id end |
Instance Method Details
#add(entity) ⇒ Object
14 15 16 17 |
# File 'lib/squeezer/models/playlist.rb', line 14 def add(entity) playlistcontrol(:cmd => :add, :entity => entity_name(entity), :id => entity.id) true end |
#clear ⇒ Object
25 26 27 |
# File 'lib/squeezer/models/playlist.rb', line 25 def clear cmd "#{id} playlist clear" end |
#load(entity) ⇒ Object
starts playing directly
20 21 22 23 |
# File 'lib/squeezer/models/playlist.rb', line 20 def load(entity) playlistcontrol(:cmd => :load, :entity => entity_name(entity), :id => entity.id) true end |