Class: SpotifyWebApi::PlaylistOwnerObject
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- SpotifyWebApi::PlaylistOwnerObject
- Defined in:
- lib/spotify_web_api/models/playlist_owner_object.rb
Overview
PlaylistOwnerObject Model.
Instance Attribute Summary collapse
-
#display_name ⇒ String
The name displayed on the user’s profile.
-
#external_urls ⇒ ExternalUrlObject
Known public external URLs for this user.
-
#followers ⇒ FollowersObject
Information about the followers of this user.
-
#href ⇒ String
A link to the Web API endpoint for this user.
-
#id ⇒ String
The [Spotify user ID](/documentation/web-api/concepts/spotify-uris-ids) for this user.
-
#type ⇒ Type4Enum
The object type.
-
#uri ⇒ String
The [Spotify URI](/documentation/web-api/concepts/spotify-uris-ids) for this user.
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(external_urls = SKIP, followers = SKIP, href = SKIP, id = SKIP, type = SKIP, uri = SKIP, display_name = SKIP) ⇒ PlaylistOwnerObject
constructor
A new instance of PlaylistOwnerObject.
Methods inherited from BaseModel
Constructor Details
#initialize(external_urls = SKIP, followers = SKIP, href = SKIP, id = SKIP, type = SKIP, uri = SKIP, display_name = SKIP) ⇒ PlaylistOwnerObject
Returns a new instance of PlaylistOwnerObject.
75 76 77 78 79 80 81 82 83 84 |
# File 'lib/spotify_web_api/models/playlist_owner_object.rb', line 75 def initialize(external_urls = SKIP, followers = SKIP, href = SKIP, id = SKIP, type = SKIP, uri = SKIP, display_name = SKIP) @external_urls = external_urls unless external_urls == SKIP @followers = followers unless followers == SKIP @href = href unless href == SKIP @id = id unless id == SKIP @type = type unless type == SKIP @uri = uri unless uri == SKIP @display_name = display_name unless display_name == SKIP end |
Instance Attribute Details
#display_name ⇒ String
The name displayed on the user’s profile. ‘null` if not available.
40 41 42 |
# File 'lib/spotify_web_api/models/playlist_owner_object.rb', line 40 def display_name @display_name end |
#external_urls ⇒ ExternalUrlObject
Known public external URLs for this user.
14 15 16 |
# File 'lib/spotify_web_api/models/playlist_owner_object.rb', line 14 def external_urls @external_urls end |
#followers ⇒ FollowersObject
Information about the followers of this user.
18 19 20 |
# File 'lib/spotify_web_api/models/playlist_owner_object.rb', line 18 def followers @followers end |
#href ⇒ String
A link to the Web API endpoint for this user.
22 23 24 |
# File 'lib/spotify_web_api/models/playlist_owner_object.rb', line 22 def href @href end |
#id ⇒ String
The [Spotify user ID](/documentation/web-api/concepts/spotify-uris-ids) for this user.
27 28 29 |
# File 'lib/spotify_web_api/models/playlist_owner_object.rb', line 27 def id @id end |
#type ⇒ Type4Enum
The object type.
31 32 33 |
# File 'lib/spotify_web_api/models/playlist_owner_object.rb', line 31 def type @type end |
#uri ⇒ String
The [Spotify URI](/documentation/web-api/concepts/spotify-uris-ids) for this user.
36 37 38 |
# File 'lib/spotify_web_api/models/playlist_owner_object.rb', line 36 def uri @uri end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
# File 'lib/spotify_web_api/models/playlist_owner_object.rb', line 87 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. external_urls = ExternalUrlObject.from_hash(hash['external_urls']) if hash['external_urls'] followers = FollowersObject.from_hash(hash['followers']) if hash['followers'] href = hash.key?('href') ? hash['href'] : SKIP id = hash.key?('id') ? hash['id'] : SKIP type = hash.key?('type') ? hash['type'] : SKIP uri = hash.key?('uri') ? hash['uri'] : SKIP display_name = hash.key?('display_name') ? hash['display_name'] : SKIP # Create object from extracted values. PlaylistOwnerObject.new(external_urls, followers, href, id, type, uri, display_name) end |
.names ⇒ Object
A mapping from model property names to API property names.
43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/spotify_web_api/models/playlist_owner_object.rb', line 43 def self.names @_hash = {} if @_hash.nil? @_hash['external_urls'] = 'external_urls' @_hash['followers'] = 'followers' @_hash['href'] = 'href' @_hash['id'] = 'id' @_hash['type'] = 'type' @_hash['uri'] = 'uri' @_hash['display_name'] = 'display_name' @_hash end |
.nullables ⇒ Object
An array for nullable fields
69 70 71 72 73 |
# File 'lib/spotify_web_api/models/playlist_owner_object.rb', line 69 def self.nullables %w[ display_name ] end |
.optionals ⇒ Object
An array for optional fields
56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/spotify_web_api/models/playlist_owner_object.rb', line 56 def self.optionals %w[ external_urls followers href id type uri display_name ] end |