Class: ShopsavvyDataApi::PriceHistoryEntry
- Inherits:
-
Object
- Object
- ShopsavvyDataApi::PriceHistoryEntry
- Defined in:
- lib/shopsavvy_data_api/models.rb
Overview
Historical price data point
Instance Attribute Summary collapse
-
#availability ⇒ Object
readonly
Returns the value of attribute availability.
-
#date ⇒ Object
readonly
Returns the value of attribute date.
-
#price ⇒ Object
readonly
Returns the value of attribute price.
Instance Method Summary collapse
-
#initialize(data) ⇒ PriceHistoryEntry
constructor
A new instance of PriceHistoryEntry.
- #to_h ⇒ Object
Constructor Details
#initialize(data) ⇒ PriceHistoryEntry
Returns a new instance of PriceHistoryEntry.
202 203 204 205 206 |
# File 'lib/shopsavvy_data_api/models.rb', line 202 def initialize(data) @date = data["date"] @price = data["price"].to_f @availability = data["availability"] end |
Instance Attribute Details
#availability ⇒ Object (readonly)
Returns the value of attribute availability.
200 201 202 |
# File 'lib/shopsavvy_data_api/models.rb', line 200 def availability @availability end |
#date ⇒ Object (readonly)
Returns the value of attribute date.
200 201 202 |
# File 'lib/shopsavvy_data_api/models.rb', line 200 def date @date end |
#price ⇒ Object (readonly)
Returns the value of attribute price.
200 201 202 |
# File 'lib/shopsavvy_data_api/models.rb', line 200 def price @price end |
Instance Method Details
#to_h ⇒ Object
208 209 210 211 212 213 214 |
# File 'lib/shopsavvy_data_api/models.rb', line 208 def to_h { date: date, price: price, availability: availability } end |