class Spotify::SDK::Album
Public Instance Methods
Is this an album? Note: This is mostly to support other types of albums in the future.
@example
album = @sdk.connect.playback.item.album album.album?
@return [TrueClass,FalseClass] is_album Returns true if type is an album.
# File lib/spotify/sdk/album.rb, line 16 def album? type == "album" end
Get the primary artist/creator for this album.
@example
@sdk.connect.playback.item.album.artist
@return [Spotify::SDK::Artist] artist The primary artist, wrapped in Spotify::SDK::Artist
# File lib/spotify/sdk/album.rb, line 57 def artist artists.first end
Get the artists/creators for this album.
@example
@sdk.connect.playback.item.album.artists
@return [Array] artists A list of artists, wrapped in Spotify::SDK::Artist
# File lib/spotify/sdk/album.rb, line 43 def artists super.map do |artist| Spotify::SDK::Artist.new(artist, parent) end end
Display the album's images.
@example
album = @sdk.connect.playback.item.album album.images[0] # => [#<Spotify::SDK::Image>, #<Spotify::SDK::Image>, ...]
@return [Array] album_images Contains a list of images, wrapped in Spotify::SDK::Image
# File lib/spotify/sdk/album.rb, line 29 def images super.map do |image| Spotify::SDK::Image.new(image, parent) end end
Get the Spotify
URI for this album. Alias to self.uri
@example
@sdk.connect.playback.item.album.spotify_uri # => "spotify:track:..."
@return [String] spotify_uri
The direct URI to this Spotify
resource.
# File lib/spotify/sdk/album.rb, line 70 alias_attribute :spotify_uri, :uri
Get the Spotify
HTTP URL for this album. Alias to self.external_urls
@example
@sdk.connect.playback.item.album.spotify_url # => "https://open.spotify.com/..."
@return [String] spotify_url
The direct HTTP URL to this Spotify
resource.
# File lib/spotify/sdk/album.rb, line 81 alias_attribute :spotify_url, "external_urls.spotify"