Class: SpotifyWebApi::ExternalUrlObject
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- SpotifyWebApi::ExternalUrlObject
- Defined in:
- lib/spotify_web_api/models/external_url_object.rb
Overview
ExternalUrlObject Model.
Instance Attribute Summary collapse
-
#spotify ⇒ String
The [Spotify URL](/documentation/web-api/concepts/spotify-uris-ids) for the object.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(spotify = SKIP) ⇒ ExternalUrlObject
constructor
A new instance of ExternalUrlObject.
Methods inherited from BaseModel
Constructor Details
#initialize(spotify = SKIP) ⇒ ExternalUrlObject
Returns a new instance of ExternalUrlObject.
36 37 38 |
# File 'lib/spotify_web_api/models/external_url_object.rb', line 36 def initialize(spotify = SKIP) @spotify = spotify unless spotify == SKIP end |
Instance Attribute Details
#spotify ⇒ String
The [Spotify URL](/documentation/web-api/concepts/spotify-uris-ids) for the object.
15 16 17 |
# File 'lib/spotify_web_api/models/external_url_object.rb', line 15 def spotify @spotify end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
41 42 43 44 45 46 47 48 49 |
# File 'lib/spotify_web_api/models/external_url_object.rb', line 41 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. spotify = hash.key?('spotify') ? hash['spotify'] : SKIP # Create object from extracted values. ExternalUrlObject.new(spotify) end |
.names ⇒ Object
A mapping from model property names to API property names.
18 19 20 21 22 |
# File 'lib/spotify_web_api/models/external_url_object.rb', line 18 def self.names @_hash = {} if @_hash.nil? @_hash['spotify'] = 'spotify' @_hash end |
.nullables ⇒ Object
An array for nullable fields
32 33 34 |
# File 'lib/spotify_web_api/models/external_url_object.rb', line 32 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
25 26 27 28 29 |
# File 'lib/spotify_web_api/models/external_url_object.rb', line 25 def self.optionals %w[ spotify ] end |