Class: SpotifyWebApi::RecommendationSeedObject
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- SpotifyWebApi::RecommendationSeedObject
- Defined in:
- lib/spotify_web_api/models/recommendation_seed_object.rb
Overview
RecommendationSeedObject Model.
Instance Attribute Summary collapse
-
#after_filtering_size ⇒ Integer
The number of tracks available after min_* and max_* filters have been applied.
-
#after_relinking_size ⇒ Integer
The number of tracks available after relinking for regional availability.
-
#href ⇒ String
A link to the full track or artist data for this seed.
-
#id ⇒ String
The id used to select this seed.
-
#initial_pool_size ⇒ Integer
The number of recommended tracks available for this seed.
-
#type ⇒ String
The entity type of this seed.
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(after_filtering_size = SKIP, after_relinking_size = SKIP, href = SKIP, id = SKIP, initial_pool_size = SKIP, type = SKIP) ⇒ RecommendationSeedObject
constructor
A new instance of RecommendationSeedObject.
Methods inherited from BaseModel
Constructor Details
#initialize(after_filtering_size = SKIP, after_relinking_size = SKIP, href = SKIP, id = SKIP, initial_pool_size = SKIP, type = SKIP) ⇒ RecommendationSeedObject
Returns a new instance of RecommendationSeedObject.
69 70 71 72 73 74 75 76 77 78 |
# File 'lib/spotify_web_api/models/recommendation_seed_object.rb', line 69 def initialize(after_filtering_size = SKIP, after_relinking_size = SKIP, href = SKIP, id = SKIP, initial_pool_size = SKIP, type = SKIP) @after_filtering_size = after_filtering_size unless after_filtering_size == SKIP @after_relinking_size = after_relinking_size unless after_relinking_size == SKIP @href = href unless href == SKIP @id = id unless id == SKIP @initial_pool_size = initial_pool_size unless initial_pool_size == SKIP @type = type unless type == SKIP end |
Instance Attribute Details
#after_filtering_size ⇒ Integer
The number of tracks available after min_* and max_* filters have been applied.
15 16 17 |
# File 'lib/spotify_web_api/models/recommendation_seed_object.rb', line 15 def after_filtering_size @after_filtering_size end |
#after_relinking_size ⇒ Integer
The number of tracks available after relinking for regional availability.
19 20 21 |
# File 'lib/spotify_web_api/models/recommendation_seed_object.rb', line 19 def after_relinking_size @after_relinking_size end |
#href ⇒ String
A link to the full track or artist data for this seed. For tracks this will be a link to a Track Object. For artists a link to an Artist Object. For genre seeds, this value will be ‘null`.
25 26 27 |
# File 'lib/spotify_web_api/models/recommendation_seed_object.rb', line 25 def href @href end |
#id ⇒ String
The id used to select this seed. This will be the same as the string used in the ‘seed_artists`, `seed_tracks` or `seed_genres` parameter.
30 31 32 |
# File 'lib/spotify_web_api/models/recommendation_seed_object.rb', line 30 def id @id end |
#initial_pool_size ⇒ Integer
The number of recommended tracks available for this seed.
34 35 36 |
# File 'lib/spotify_web_api/models/recommendation_seed_object.rb', line 34 def initial_pool_size @initial_pool_size end |
#type ⇒ String
The entity type of this seed. One of ‘artist`, `track` or `genre`.
38 39 40 |
# File 'lib/spotify_web_api/models/recommendation_seed_object.rb', line 38 def type @type end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
# File 'lib/spotify_web_api/models/recommendation_seed_object.rb', line 81 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. after_filtering_size = hash.key?('afterFilteringSize') ? hash['afterFilteringSize'] : SKIP after_relinking_size = hash.key?('afterRelinkingSize') ? hash['afterRelinkingSize'] : SKIP href = hash.key?('href') ? hash['href'] : SKIP id = hash.key?('id') ? hash['id'] : SKIP initial_pool_size = hash.key?('initialPoolSize') ? hash['initialPoolSize'] : SKIP type = hash.key?('type') ? hash['type'] : SKIP # Create object from extracted values. RecommendationSeedObject.new(after_filtering_size, after_relinking_size, href, id, initial_pool_size, type) end |
.names ⇒ Object
A mapping from model property names to API property names.
41 42 43 44 45 46 47 48 49 50 |
# File 'lib/spotify_web_api/models/recommendation_seed_object.rb', line 41 def self.names @_hash = {} if @_hash.nil? @_hash['after_filtering_size'] = 'afterFilteringSize' @_hash['after_relinking_size'] = 'afterRelinkingSize' @_hash['href'] = 'href' @_hash['id'] = 'id' @_hash['initial_pool_size'] = 'initialPoolSize' @_hash['type'] = 'type' @_hash end |
.nullables ⇒ Object
An array for nullable fields
65 66 67 |
# File 'lib/spotify_web_api/models/recommendation_seed_object.rb', line 65 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
53 54 55 56 57 58 59 60 61 62 |
# File 'lib/spotify_web_api/models/recommendation_seed_object.rb', line 53 def self.optionals %w[ after_filtering_size after_relinking_size href id initial_pool_size type ] end |