Class: Java::DeFelixbrunsJotifyMedia::Playlist
- Inherits:
-
Object
- Object
- Java::DeFelixbrunsJotifyMedia::Playlist
- Includes:
- Enumerable
- Defined in:
- lib/jotify/media.rb
Instance Method Summary collapse
- #<<(track) ⇒ Object
- #collaborative? ⇒ Boolean
- #each(&block) ⇒ Object
- #inspect ⇒ Object
- #size ⇒ Object
- #to_h ⇒ Object
Instance Method Details
#<<(track) ⇒ Object
50 51 52 |
# File 'lib/jotify/media.rb', line 50 def <<(track) tracks.add(track) if track.is_a?(Track) end |
#collaborative? ⇒ Boolean
30 31 32 |
# File 'lib/jotify/media.rb', line 30 def collaborative? isCollaborative() end |
#each(&block) ⇒ Object
22 23 24 |
# File 'lib/jotify/media.rb', line 22 def each(&block) tracks.each(&block) end |
#inspect ⇒ Object
34 35 36 |
# File 'lib/jotify/media.rb', line 34 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
38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/jotify/media.rb', line 38 def to_h { :id => getId(), :name=> name, :url => link.asHTTPLink, :tracks => tracks.map { |t| t.to_h }, :author => , :revision => revision, :collaborative => collaborative } end |