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.
176 177 178 179 180 181 182 183 |
# File 'lib/shopsavvy_data_api/models.rb', line 176 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.
173 174 175 |
# File 'lib/shopsavvy_data_api/models.rb', line 173 def created_at @created_at end |
#frequency ⇒ Object (readonly)
Returns the value of attribute frequency.
173 174 175 |
# File 'lib/shopsavvy_data_api/models.rb', line 173 def frequency @frequency end |
#identifier ⇒ Object (readonly)
Returns the value of attribute identifier.
173 174 175 |
# File 'lib/shopsavvy_data_api/models.rb', line 173 def identifier @identifier end |
#last_refreshed ⇒ Object (readonly)
Returns the value of attribute last_refreshed.
173 174 175 |
# File 'lib/shopsavvy_data_api/models.rb', line 173 def last_refreshed @last_refreshed end |
#product_id ⇒ Object (readonly)
Returns the value of attribute product_id.
173 174 175 |
# File 'lib/shopsavvy_data_api/models.rb', line 173 def product_id @product_id end |
#retailer ⇒ Object (readonly)
Returns the value of attribute retailer.
173 174 175 |
# File 'lib/shopsavvy_data_api/models.rb', line 173 def retailer @retailer end |
Instance Method Details
#daily? ⇒ Boolean
200 201 202 |
# File 'lib/shopsavvy_data_api/models.rb', line 200 def daily? frequency == "daily" end |
#hourly? ⇒ Boolean
196 197 198 |
# File 'lib/shopsavvy_data_api/models.rb', line 196 def hourly? frequency == "hourly" end |
#to_h ⇒ Object
185 186 187 188 189 190 191 192 193 194 |
# File 'lib/shopsavvy_data_api/models.rb', line 185 def to_h { product_id: product_id, identifier: identifier, frequency: frequency, retailer: retailer, created_at: created_at, last_refreshed: last_refreshed } end |
#weekly? ⇒ Boolean
204 205 206 |
# File 'lib/shopsavvy_data_api/models.rb', line 204 def weekly? frequency == "weekly" end |