Class: BudaApi::Models::AveragePrice
- Defined in:
- lib/buda_api/models.rb
Overview
Average price report entry
Instance Attribute Summary collapse
-
#average ⇒ Object
readonly
Returns the value of attribute average.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
Instance Method Summary collapse
-
#initialize(data) ⇒ AveragePrice
constructor
A new instance of AveragePrice.
Methods inherited from BaseModel
Constructor Details
#initialize(data) ⇒ AveragePrice
341 342 343 344 345 |
# File 'lib/buda_api/models.rb', line 341 def initialize(data) super(data) = Time.at(data["timestamp"].to_i) if data["timestamp"] @average = data["average"]&.to_f end |
Instance Attribute Details
#average ⇒ Object (readonly)
Returns the value of attribute average.
347 348 349 |
# File 'lib/buda_api/models.rb', line 347 def average @average end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
347 348 349 |
# File 'lib/buda_api/models.rb', line 347 def end |