Class: Hallon::Artist
- Defined in:
- lib/hallon/artist.rb
Overview
Artists in Hallon are the people behind the songs. Methods are defined for retrieving their names and loaded status.
To retrieve more information about an artist, you can #browse it. This will give access to more detailed data such as bio, portraits and more.
Both Albums and Tracks can have more than one artist.
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#browse(type = :full) ⇒ ArtistBrowse
Browse the Artist, giving you the ability to explore its’ portraits, biography and more.
-
#from_link ⇒ Spotify::Link
private
Pointer representation of given link.
-
#initialize(link) ⇒ Artist
constructor
Construct an Artist from a link.
-
#loaded? ⇒ Boolean
True if the artist is loaded.
-
#name ⇒ String
Name of the artist.
-
#portrait(size = :normal) ⇒ Image?
Artist portrait as an Image.
-
#portrait_link(size = :normal) ⇒ Link?
Artist portrait as a Link.
-
#to_link ⇒ Hallon::Link
Link for the current object.
Methods included from Loadable
Methods included from Linkable
Methods inherited from Base
#==, from, from_link, #is_linkable?, #session, to_link, #to_pointer, #to_s
Constructor Details
Instance Method Details
#browse(type = :full) ⇒ ArtistBrowse
Browse the Artist, giving you the ability to explore its’ portraits, biography and more.
67 68 69 |
# File 'lib/hallon/artist.rb', line 67 def browse(type = :full) ArtistBrowse.new(pointer, type) end |
#from_link ⇒ Spotify::Link (private)
Returns pointer representation of given link.
17 |
# File 'lib/hallon/artist.rb', line 17 from_link :as_artist |
#loaded? ⇒ Boolean
Returns true if the artist is loaded.
42 43 44 |
# File 'lib/hallon/artist.rb', line 42 def loaded? Spotify.artist_is_loaded(pointer) end |
#name ⇒ String
Returns name of the artist.
37 38 39 |
# File 'lib/hallon/artist.rb', line 37 def name Spotify.artist_name(pointer) end |
#portrait(size = :normal) ⇒ Image?
Returns artist portrait as an Image.
49 50 51 52 |
# File 'lib/hallon/artist.rb', line 49 def portrait(size = :normal) portrait = Spotify.artist_portrait(pointer, size) Image.from(portrait) end |
#portrait_link(size = :normal) ⇒ Link?
Returns artist portrait as a Link.
57 58 59 60 |
# File 'lib/hallon/artist.rb', line 57 def portrait_link(size = :normal) portrait = Spotify.link_create_from_artist_portrait(pointer, size) Link.from(portrait) end |
#to_link ⇒ Hallon::Link
Returns Link for the current object.
18 |
# File 'lib/hallon/artist.rb', line 18 to_link :from_artist |