Class: SpotifyWebApi::Meta
- Defined in:
- lib/spotify_web_api/models/meta.rb
Overview
Meta Model.
Instance Attribute Summary collapse
-
#analysis_time ⇒ Float
The amount of time taken to analyze this track.
-
#analyzer_version ⇒ String
The version of the Analyzer used to analyze this track.
-
#detailed_status ⇒ String
A detailed status code for this track.
-
#input_process ⇒ String
The method used to read the track’s audio data.
-
#platform ⇒ String
The platform used to read the track’s audio data.
-
#status_code ⇒ Integer
The return code of the analyzer process.
-
#timestamp ⇒ Integer
The Unix timestamp (in seconds) at which this track was analyzed.
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(analyzer_version = SKIP, platform = SKIP, detailed_status = SKIP, status_code = SKIP, timestamp = SKIP, analysis_time = SKIP, input_process = SKIP) ⇒ Meta
constructor
A new instance of Meta.
Methods inherited from BaseModel
Constructor Details
#initialize(analyzer_version = SKIP, platform = SKIP, detailed_status = SKIP, status_code = SKIP, timestamp = SKIP, analysis_time = SKIP, input_process = SKIP) ⇒ Meta
Returns a new instance of Meta.
73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/spotify_web_api/models/meta.rb', line 73 def initialize(analyzer_version = SKIP, platform = SKIP, detailed_status = SKIP, status_code = SKIP, = SKIP, analysis_time = SKIP, input_process = SKIP) @analyzer_version = analyzer_version unless analyzer_version == SKIP @platform = platform unless platform == SKIP @detailed_status = detailed_status unless detailed_status == SKIP @status_code = status_code unless status_code == SKIP @timestamp = unless == SKIP @analysis_time = analysis_time unless analysis_time == SKIP @input_process = input_process unless input_process == SKIP end |
Instance Attribute Details
#analysis_time ⇒ Float
The amount of time taken to analyze this track.
36 37 38 |
# File 'lib/spotify_web_api/models/meta.rb', line 36 def analysis_time @analysis_time end |
#analyzer_version ⇒ String
The version of the Analyzer used to analyze this track.
14 15 16 |
# File 'lib/spotify_web_api/models/meta.rb', line 14 def analyzer_version @analyzer_version end |
#detailed_status ⇒ String
A detailed status code for this track. If analysis data is missing, this code may explain why.
23 24 25 |
# File 'lib/spotify_web_api/models/meta.rb', line 23 def detailed_status @detailed_status end |
#input_process ⇒ String
The method used to read the track’s audio data.
40 41 42 |
# File 'lib/spotify_web_api/models/meta.rb', line 40 def input_process @input_process end |
#platform ⇒ String
The platform used to read the track’s audio data.
18 19 20 |
# File 'lib/spotify_web_api/models/meta.rb', line 18 def platform @platform end |
#status_code ⇒ Integer
The return code of the analyzer process. 0 if successful, 1 if any errors occurred.
28 29 30 |
# File 'lib/spotify_web_api/models/meta.rb', line 28 def status_code @status_code end |
#timestamp ⇒ Integer
The Unix timestamp (in seconds) at which this track was analyzed.
32 33 34 |
# File 'lib/spotify_web_api/models/meta.rb', line 32 def @timestamp end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/spotify_web_api/models/meta.rb', line 86 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. analyzer_version = hash.key?('analyzer_version') ? hash['analyzer_version'] : SKIP platform = hash.key?('platform') ? hash['platform'] : SKIP detailed_status = hash.key?('detailed_status') ? hash['detailed_status'] : SKIP status_code = hash.key?('status_code') ? hash['status_code'] : SKIP = hash.key?('timestamp') ? hash['timestamp'] : SKIP analysis_time = hash.key?('analysis_time') ? hash['analysis_time'] : SKIP input_process = hash.key?('input_process') ? hash['input_process'] : SKIP # Create object from extracted values. Meta.new(analyzer_version, platform, detailed_status, status_code, , analysis_time, input_process) 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/meta.rb', line 43 def self.names @_hash = {} if @_hash.nil? @_hash['analyzer_version'] = 'analyzer_version' @_hash['platform'] = 'platform' @_hash['detailed_status'] = 'detailed_status' @_hash['status_code'] = 'status_code' @_hash['timestamp'] = 'timestamp' @_hash['analysis_time'] = 'analysis_time' @_hash['input_process'] = 'input_process' @_hash end |
.nullables ⇒ Object
An array for nullable fields
69 70 71 |
# File 'lib/spotify_web_api/models/meta.rb', line 69 def self.nullables [] 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/meta.rb', line 56 def self.optionals %w[ analyzer_version platform detailed_status status_code timestamp analysis_time input_process ] end |