Class: SpotifyWebApi::ResumePointObject
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- SpotifyWebApi::ResumePointObject
- Defined in:
- lib/spotify_web_api/models/resume_point_object.rb
Overview
ResumePointObject Model.
Instance Attribute Summary collapse
-
#fully_played ⇒ TrueClass | FalseClass
Whether or not the episode has been fully played by the user.
-
#resume_position_ms ⇒ Integer
The user’s most recent position in the episode in milliseconds.
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(fully_played = SKIP, resume_position_ms = SKIP) ⇒ ResumePointObject
constructor
A new instance of ResumePointObject.
Methods inherited from BaseModel
Constructor Details
#initialize(fully_played = SKIP, resume_position_ms = SKIP) ⇒ ResumePointObject
Returns a new instance of ResumePointObject.
41 42 43 44 |
# File 'lib/spotify_web_api/models/resume_point_object.rb', line 41 def initialize(fully_played = SKIP, resume_position_ms = SKIP) @fully_played = fully_played unless fully_played == SKIP @resume_position_ms = resume_position_ms unless resume_position_ms == SKIP end |
Instance Attribute Details
#fully_played ⇒ TrueClass | FalseClass
Whether or not the episode has been fully played by the user.
14 15 16 |
# File 'lib/spotify_web_api/models/resume_point_object.rb', line 14 def fully_played @fully_played end |
#resume_position_ms ⇒ Integer
The user’s most recent position in the episode in milliseconds.
18 19 20 |
# File 'lib/spotify_web_api/models/resume_point_object.rb', line 18 def resume_position_ms @resume_position_ms end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/spotify_web_api/models/resume_point_object.rb', line 47 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. fully_played = hash.key?('fully_played') ? hash['fully_played'] : SKIP resume_position_ms = hash.key?('resume_position_ms') ? hash['resume_position_ms'] : SKIP # Create object from extracted values. ResumePointObject.new(fully_played, resume_position_ms) end |
.names ⇒ Object
A mapping from model property names to API property names.
21 22 23 24 25 26 |
# File 'lib/spotify_web_api/models/resume_point_object.rb', line 21 def self.names @_hash = {} if @_hash.nil? @_hash['fully_played'] = 'fully_played' @_hash['resume_position_ms'] = 'resume_position_ms' @_hash end |
.nullables ⇒ Object
An array for nullable fields
37 38 39 |
# File 'lib/spotify_web_api/models/resume_point_object.rb', line 37 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
29 30 31 32 33 34 |
# File 'lib/spotify_web_api/models/resume_point_object.rb', line 29 def self.optionals %w[ fully_played resume_position_ms ] end |