Class: SpotifyWebApi::CopyrightObject
- Defined in:
- lib/spotify_web_api/models/copyright_object.rb
Overview
CopyrightObject Model.
Instance Attribute Summary collapse
-
#text ⇒ String
The copyright text for this content.
-
#type ⇒ String
The type of copyright: ‘C` = the copyright, `P` = the sound recording (performance) copyright.
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(text = SKIP, type = SKIP) ⇒ CopyrightObject
constructor
A new instance of CopyrightObject.
Methods inherited from BaseModel
Constructor Details
#initialize(text = SKIP, type = SKIP) ⇒ CopyrightObject
Returns a new instance of CopyrightObject.
42 43 44 45 |
# File 'lib/spotify_web_api/models/copyright_object.rb', line 42 def initialize(text = SKIP, type = SKIP) @text = text unless text == SKIP @type = type unless type == SKIP end |
Instance Attribute Details
#text ⇒ String
The copyright text for this content.
14 15 16 |
# File 'lib/spotify_web_api/models/copyright_object.rb', line 14 def text @text end |
#type ⇒ String
The type of copyright: ‘C` = the copyright, `P` = the sound recording (performance) copyright.
19 20 21 |
# File 'lib/spotify_web_api/models/copyright_object.rb', line 19 def type @type 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 |
# File 'lib/spotify_web_api/models/copyright_object.rb', line 48 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. text = hash.key?('text') ? hash['text'] : SKIP type = hash.key?('type') ? hash['type'] : SKIP # Create object from extracted values. CopyrightObject.new(text, type) 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/copyright_object.rb', line 22 def self.names @_hash = {} if @_hash.nil? @_hash['text'] = 'text' @_hash['type'] = 'type' @_hash end |
.nullables ⇒ Object
An array for nullable fields
38 39 40 |
# File 'lib/spotify_web_api/models/copyright_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/copyright_object.rb', line 30 def self.optionals %w[ text type ] end |