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



68
69
70
71
72
# File 'lib/jotify/media.rb', line 68

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

#inspectObject



74
75
76
# File 'lib/jotify/media.rb', line 74

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

#to_hObject



78
79
80
81
82
83
84
# File 'lib/jotify/media.rb', line 78

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