Class: Spotify::SDK::Image
- Defined in:
- lib/spotify/sdk/image.rb
Instance Attribute Summary
Attributes inherited from Model
Instance Method Summary collapse
-
#id ⇒ String
Get the ID of the image.
-
#spotify_uri ⇒ String
Get the mobile-related link for the image.
-
#spotify_url ⇒ String
Get the HTTP link for the image.
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
#id ⇒ String
Get the ID of the image.
15 16 17 |
# File 'lib/spotify/sdk/image.rb', line 15 def id url.match(/[a-z0-9]+$/i)[0] end |
#spotify_uri ⇒ String
Get the mobile-related link for the image. Designed for offline mobile apps.
28 29 30 |
# File 'lib/spotify/sdk/image.rb', line 28 def spotify_uri "spotify:image:%s" % id end |
#spotify_url ⇒ String
Get the HTTP link for the image. Designed for web apps.
41 |
# File 'lib/spotify/sdk/image.rb', line 41 alias_attribute :spotify_url, :url |