class ItunesApi::Music::Artist
Artist
or Band from the Apple catalog
Public Class Methods
find_by_apple_id(apple_id, store)
click to toggle source
# File lib/itunes_api/music/artist.rb, line 16 def find_by_apple_id(apple_id, store) result = artists(apple_id, store).first new(*result.attributes) if result end
find_by_name(name, store)
click to toggle source
# File lib/itunes_api/music/artist.rb, line 10 def find_by_name(name, store) Requests::Search.artists(name, store).map do |result| new(*result.attributes) end end
Private Class Methods
artists(id, store)
click to toggle source
# File lib/itunes_api/music/artist.rb, line 24 def artists(id, store) Requests::Artist.find_by_id(id, store) end
Public Instance Methods
albums()
click to toggle source
# File lib/itunes_api/music/artist.rb, line 29 def albums @albums ||= Album.find_by_apple_id(apple_id, store) end
to_hash()
click to toggle source
# File lib/itunes_api/music/artist.rb, line 33 def to_hash { amg_id: amg_id, apple_id: apple_id, genre: genre, link: link, name: name, store: store } end