Class: Withings::Api::MeasureGetmeasResults
- Inherits:
-
Object
- Object
- Withings::Api::MeasureGetmeasResults
- Includes:
- ResultsHelpers
- Defined in:
- lib/withings-api/results/measure_getmeas_results.rb
Overview
Class encapsulating the response to a call to measure/getmeas
Instance Attribute Summary collapse
-
#measure_groups ⇒ Object
Returns the value of attribute measure_groups.
-
#more ⇒ Object
(also: #more?)
Returns the value of attribute more.
-
#update_time_raw ⇒ Object
Returns the value of attribute update_time_raw.
Instance Method Summary collapse
-
#initialize(json_or_hash) ⇒ MeasureGetmeasResults
constructor
A new instance of MeasureGetmeasResults.
- #update_time ⇒ Object
Methods included from ResultsHelpers
Constructor Details
#initialize(json_or_hash) ⇒ MeasureGetmeasResults
Returns a new instance of MeasureGetmeasResults.
60 61 62 63 64 65 66 |
# File 'lib/withings-api/results/measure_getmeas_results.rb', line 60 def initialize(json_or_hash) hash = coerce_hash json_or_hash self.update_time_raw = hash["updatetime"] || raise(ArgumentError) self.more = (hash["more"] == true) self.measure_groups = hash["measuregrps"].map { |h| MeasurementGroup.new(h) } end |
Instance Attribute Details
#measure_groups ⇒ Object
Returns the value of attribute measure_groups.
57 58 59 |
# File 'lib/withings-api/results/measure_getmeas_results.rb', line 57 def measure_groups @measure_groups end |
#more ⇒ Object Also known as: more?
Returns the value of attribute more.
57 58 59 |
# File 'lib/withings-api/results/measure_getmeas_results.rb', line 57 def more @more end |
#update_time_raw ⇒ Object
Returns the value of attribute update_time_raw.
57 58 59 |
# File 'lib/withings-api/results/measure_getmeas_results.rb', line 57 def update_time_raw @update_time_raw end |
Instance Method Details
#update_time ⇒ Object
68 69 70 |
# File 'lib/withings-api/results/measure_getmeas_results.rb', line 68 def update_time Time.at(update_time_raw) end |