Class: Java::DeFelixbrunsJotifyMedia::Playlist
- Inherits:
-
Object
- Object
- Java::DeFelixbrunsJotifyMedia::Playlist
- Includes:
- Enumerable
- Defined in:
- lib/jotify/media.rb
Instance Method Summary collapse
Instance Method Details
#<<(track) ⇒ Object
46 47 48 |
# File 'lib/jotify/media.rb', line 46 def <<(track) tracks.add(track) if track.is_a?(Track) end |
#each(&block) ⇒ Object
22 23 24 |
# File 'lib/jotify/media.rb', line 22 def each(&block) tracks.each(&block) end |
#inspect ⇒ Object
30 31 32 |
# File 'lib/jotify/media.rb', line 30 def inspect "[Playlist: #{self.getId()} #{getTracks.to_a}]" end |
#size ⇒ Object
26 27 28 |
# File 'lib/jotify/media.rb', line 26 def size tracks.size end |
#to_h ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/jotify/media.rb', line 34 def to_h { :id => getId(), :name=> name, :url => link, :tracks => tracks.map { |t| t.to_h }, :author => , :revision => revision, :collaborative => collaborative } end |