Class: ShopsavvyDataApi::ScheduledProduct
- Inherits:
-
Object
- Object
- ShopsavvyDataApi::ScheduledProduct
- Defined in:
- lib/shopsavvy_data_api/models.rb
Overview
Scheduled product monitoring information
Instance Attribute Summary collapse
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#frequency ⇒ Object
readonly
Returns the value of attribute frequency.
-
#identifier ⇒ Object
readonly
Returns the value of attribute identifier.
-
#last_refreshed ⇒ Object
readonly
Returns the value of attribute last_refreshed.
-
#product_id ⇒ Object
readonly
Returns the value of attribute product_id.
-
#retailer ⇒ Object
readonly
Returns the value of attribute retailer.
Instance Method Summary collapse
- #daily? ⇒ Boolean
- #hourly? ⇒ Boolean
-
#initialize(data) ⇒ ScheduledProduct
constructor
A new instance of ScheduledProduct.
- #to_h ⇒ Object
- #weekly? ⇒ Boolean
Constructor Details
#initialize(data) ⇒ ScheduledProduct
Returns a new instance of ScheduledProduct.
255 256 257 258 259 260 261 262 |
# File 'lib/shopsavvy_data_api/models.rb', line 255 def initialize(data) @product_id = data["product_id"] @identifier = data["identifier"] @frequency = data["frequency"] @retailer = data["retailer"] @created_at = data["created_at"] @last_refreshed = data["last_refreshed"] end |
Instance Attribute Details
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
252 253 254 |
# File 'lib/shopsavvy_data_api/models.rb', line 252 def created_at @created_at end |
#frequency ⇒ Object (readonly)
Returns the value of attribute frequency.
252 253 254 |
# File 'lib/shopsavvy_data_api/models.rb', line 252 def frequency @frequency end |
#identifier ⇒ Object (readonly)
Returns the value of attribute identifier.
252 253 254 |
# File 'lib/shopsavvy_data_api/models.rb', line 252 def identifier @identifier end |
#last_refreshed ⇒ Object (readonly)
Returns the value of attribute last_refreshed.
252 253 254 |
# File 'lib/shopsavvy_data_api/models.rb', line 252 def last_refreshed @last_refreshed end |
#product_id ⇒ Object (readonly)
Returns the value of attribute product_id.
252 253 254 |
# File 'lib/shopsavvy_data_api/models.rb', line 252 def product_id @product_id end |
#retailer ⇒ Object (readonly)
Returns the value of attribute retailer.
252 253 254 |
# File 'lib/shopsavvy_data_api/models.rb', line 252 def retailer @retailer end |
Instance Method Details
#daily? ⇒ Boolean
279 280 281 |
# File 'lib/shopsavvy_data_api/models.rb', line 279 def daily? frequency == "daily" end |
#hourly? ⇒ Boolean
275 276 277 |
# File 'lib/shopsavvy_data_api/models.rb', line 275 def hourly? frequency == "hourly" end |
#to_h ⇒ Object
264 265 266 267 268 269 270 271 272 273 |
# File 'lib/shopsavvy_data_api/models.rb', line 264 def to_h { product_id: product_id, identifier: identifier, frequency: frequency, retailer: retailer, created_at: created_at, last_refreshed: last_refreshed } end |
#weekly? ⇒ Boolean
283 284 285 |
# File 'lib/shopsavvy_data_api/models.rb', line 283 def weekly? frequency == "weekly" end |