Class: ShopsavvyDataApi::ScheduledProduct

Inherits:
Object
  • Object
show all
Defined in:
lib/shopsavvy_data_api/models.rb

Overview

Scheduled product monitoring information

Instance Attribute Summary collapse

Instance Method Summary collapse

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_atObject (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

#frequencyObject (readonly)

Returns the value of attribute frequency.



252
253
254
# File 'lib/shopsavvy_data_api/models.rb', line 252

def frequency
  @frequency
end

#identifierObject (readonly)

Returns the value of attribute identifier.



252
253
254
# File 'lib/shopsavvy_data_api/models.rb', line 252

def identifier
  @identifier
end

#last_refreshedObject (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_idObject (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

#retailerObject (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

Returns:

  • (Boolean)


279
280
281
# File 'lib/shopsavvy_data_api/models.rb', line 279

def daily?
  frequency == "daily"
end

#hourly?Boolean

Returns:

  • (Boolean)


275
276
277
# File 'lib/shopsavvy_data_api/models.rb', line 275

def hourly?
  frequency == "hourly"
end

#to_hObject



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

Returns:

  • (Boolean)


283
284
285
# File 'lib/shopsavvy_data_api/models.rb', line 283

def weekly?
  frequency == "weekly"
end