Class: Java::DeFelixbrunsJotifyMedia::Playlist

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/jotify/media.rb

Instance Method Summary collapse

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

Returns:

  • (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

#inspectObject



34
35
36
# File 'lib/jotify/media.rb', line 34

def inspect
  "[Playlist: #{self.getId()} #{getTracks.to_a}]"
end

#sizeObject



26
27
28
# File 'lib/jotify/media.rb', line 26

def size
  tracks.size
end

#to_hObject



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 => author,
    :revision => revision,
    :collaborative => collaborative
  }
end