Class: Java::DeFelixbrunsJotifyMedia::Result

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

Instance Method Summary collapse

Instance Method Details

#each(&block) ⇒ Object



54
55
56
57
58
# File 'lib/jotify/media.rb', line 54

def each(&block)
  artists.each(&block)
  tracks.each(&block)
  albums.each(&block)
end

#inspectObject



60
61
62
# File 'lib/jotify/media.rb', line 60

def inspect
  { :artists=>self.artists.to_a, :albums=>self.albums.to_a, :tracks=>self.tracks.to_a }.inspect
end

#to_hObject



64
65
66
67
68
69
70
# File 'lib/jotify/media.rb', line 64

def to_h
  { 
    :artists => self.artists.map { |a| a.to_h },
    :albums => self.albums.map { |a| a.to_h },
    :tracks => self.tracks.map { |t| t.to_h }
  }
end