Class: SpotifyWebApi::ExplicitContentSettingsObject
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- SpotifyWebApi::ExplicitContentSettingsObject
- Defined in:
- lib/spotify_web_api/models/explicit_content_settings_object.rb
Overview
ExplicitContentSettingsObject Model.
Instance Attribute Summary collapse
-
#filter_enabled ⇒ TrueClass | FalseClass
When ‘true`, indicates that explicit content should not be played.
-
#filter_locked ⇒ TrueClass | FalseClass
When ‘true`, indicates that the explicit content setting is locked and can’t be changed by the 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(filter_enabled = SKIP, filter_locked = SKIP) ⇒ ExplicitContentSettingsObject
constructor
A new instance of ExplicitContentSettingsObject.
Methods inherited from BaseModel
Constructor Details
#initialize(filter_enabled = SKIP, filter_locked = SKIP) ⇒ ExplicitContentSettingsObject
Returns a new instance of ExplicitContentSettingsObject.
42 43 44 45 |
# File 'lib/spotify_web_api/models/explicit_content_settings_object.rb', line 42 def initialize(filter_enabled = SKIP, filter_locked = SKIP) @filter_enabled = filter_enabled unless filter_enabled == SKIP @filter_locked = filter_locked unless filter_locked == SKIP end |
Instance Attribute Details
#filter_enabled ⇒ TrueClass | FalseClass
When ‘true`, indicates that explicit content should not be played.
14 15 16 |
# File 'lib/spotify_web_api/models/explicit_content_settings_object.rb', line 14 def filter_enabled @filter_enabled end |
#filter_locked ⇒ TrueClass | FalseClass
When ‘true`, indicates that the explicit content setting is locked and can’t be changed by the user.
19 20 21 |
# File 'lib/spotify_web_api/models/explicit_content_settings_object.rb', line 19 def filter_locked @filter_locked end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/spotify_web_api/models/explicit_content_settings_object.rb', line 48 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. filter_enabled = hash.key?('filter_enabled') ? hash['filter_enabled'] : SKIP filter_locked = hash.key?('filter_locked') ? hash['filter_locked'] : SKIP # Create object from extracted values. ExplicitContentSettingsObject.new(filter_enabled, filter_locked) end |
.names ⇒ Object
A mapping from model property names to API property names.
22 23 24 25 26 27 |
# File 'lib/spotify_web_api/models/explicit_content_settings_object.rb', line 22 def self.names @_hash = {} if @_hash.nil? @_hash['filter_enabled'] = 'filter_enabled' @_hash['filter_locked'] = 'filter_locked' @_hash end |
.nullables ⇒ Object
An array for nullable fields
38 39 40 |
# File 'lib/spotify_web_api/models/explicit_content_settings_object.rb', line 38 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
30 31 32 33 34 35 |
# File 'lib/spotify_web_api/models/explicit_content_settings_object.rb', line 30 def self.optionals %w[ filter_enabled filter_locked ] end |