Class: Spotify::SDK::Album
- Defined in:
- lib/spotify/sdk/album.rb
Instance Attribute Summary
Attributes inherited from Model
Instance Method Summary collapse
-
#album? ⇒ TrueClass, FalseClass
Is this an album? Note: This is mostly to support other types of albums in the future.
-
#artist ⇒ Spotify::SDK::Artist
Get the primary artist/creator for this album.
-
#artists ⇒ Array
Get the artists/creators for this album.
-
#images ⇒ Array
Display the album's images.
-
#spotify_uri ⇒ String
Get the Spotify URI for this album.
-
#spotify_url ⇒ String
Get the Spotify HTTP URL for this album.
Methods inherited from Model
alias_attribute, hash_selector, #initialize, #to_h, #to_json
Constructor Details
This class inherits a constructor from Spotify::SDK::Model
Instance Method Details
#album? ⇒ TrueClass, FalseClass
Is this an album? Note: This is mostly to support other types of albums in the future.
16 17 18 |
# File 'lib/spotify/sdk/album.rb', line 16 def album? type == "album" end |
#artist ⇒ Spotify::SDK::Artist
Get the primary artist/creator for this album.
57 58 59 |
# File 'lib/spotify/sdk/album.rb', line 57 def artist artists.first end |
#artists ⇒ Array
Get the artists/creators for this album.
43 44 45 46 47 |
# File 'lib/spotify/sdk/album.rb', line 43 def artists super.map do |artist| Spotify::SDK::Artist.new(artist, parent) end end |
#images ⇒ Array
Display the album's images.
29 30 31 32 33 |
# File 'lib/spotify/sdk/album.rb', line 29 def images super.map do |image| Spotify::SDK::Image.new(image, parent) end end |
#spotify_uri ⇒ String
Get the Spotify URI for this album. Alias to self.uri
70 |
# File 'lib/spotify/sdk/album.rb', line 70 alias_attribute :spotify_uri, :uri |
#spotify_url ⇒ String
Get the Spotify HTTP URL for this album. Alias to self.external_urls
81 |
# File 'lib/spotify/sdk/album.rb', line 81 alias_attribute :spotify_url, "external_urls.spotify" |