Class: Spotify::SDK::Item
- Defined in:
- lib/spotify/sdk/item.rb
Instance Attribute Summary
Attributes inherited from Model
Instance Method Summary collapse
-
#album ⇒ Spotify::SDK::Album
Get the album for this item.
-
#artist ⇒ Spotify::SDK::Artist
Get the primary artist/creator for this item.
-
#artists ⇒ Array
Get the artists/creators for this item.
-
#duration ⇒ Integer
Get the duration.
-
#explicit? ⇒ TrueClass, FalseClass
Is this track explicit? Alias to self.explicit.
-
#isrc ⇒ String
Get the ISRC for this track.
-
#local? ⇒ TrueClass, FalseClass
Is this a local track, not a Spotify track? Alias to self.is_local.
-
#playable? ⇒ TrueClass, FalseClass
Is this a playable track? Alias to self.is_playable.
-
#spotify_uri ⇒ String
Get the Spotify URI for this item.
-
#spotify_url ⇒ String
Get the Spotify HTTP URL for this item.
-
#track? ⇒ TrueClass, FalseClass
Is this a track? Alias to self.type == “track”.
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 ⇒ Spotify::SDK::Album
Get the album for this item.
14 15 16 |
# File 'lib/spotify/sdk/item.rb', line 14 def album Spotify::SDK::Album.new(super, parent) end |
#artist ⇒ Spotify::SDK::Artist
Get the primary artist/creator for this item.
40 41 42 |
# File 'lib/spotify/sdk/item.rb', line 40 def artist artists.first end |
#artists ⇒ Array
Get the artists/creators for this item.
26 27 28 29 30 |
# File 'lib/spotify/sdk/item.rb', line 26 def artists super.map do |artist| Spotify::SDK::Artist.new(artist, parent) end end |
#duration ⇒ Integer
Get the duration. Alias to self.duration_ms
53 |
# File 'lib/spotify/sdk/item.rb', line 53 alias_attribute :duration, :duration_ms |
#explicit? ⇒ TrueClass, FalseClass
Is this track explicit? Alias to self.explicit
64 |
# File 'lib/spotify/sdk/item.rb', line 64 alias_attribute :explicit?, :explicit |
#isrc ⇒ String
Get the ISRC for this track.
131 |
# File 'lib/spotify/sdk/item.rb', line 131 alias_attribute :isrc, "external_ids.isrc" |
#local? ⇒ TrueClass, FalseClass
Is this a local track, not a Spotify track? Alias to self.is_local
75 |
# File 'lib/spotify/sdk/item.rb', line 75 alias_attribute :local?, :is_local |
#playable? ⇒ TrueClass, FalseClass
Is this a playable track? Alias to self.is_playable
86 |
# File 'lib/spotify/sdk/item.rb', line 86 alias_attribute :playable?, :is_playable |
#spotify_uri ⇒ String
Get the Spotify URI for this item. Alias to self.uri
110 |
# File 'lib/spotify/sdk/item.rb', line 110 alias_attribute :spotify_uri, :uri |
#spotify_url ⇒ String
Get the Spotify HTTP URL for this item. Alias to self.external_urls
121 |
# File 'lib/spotify/sdk/item.rb', line 121 alias_attribute :spotify_url, "external_urls.spotify" |
#track? ⇒ TrueClass, FalseClass
Is this a track? Alias to self.type == “track”
97 98 99 |
# File 'lib/spotify/sdk/item.rb', line 97 def track? type == "track" end |