Class: Access::Product
- Inherits:
-
Object
- Object
- Access::Product
- Includes:
- MuchMeta
- Defined in:
- lib/access/product.rb
Instance Attribute Summary collapse
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#store ⇒ Object
readonly
Returns the value of attribute store.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(values) ⇒ Product
constructor
A new instance of Product.
Methods included from MuchMeta
Constructor Details
#initialize(values) ⇒ Product
Returns a new instance of Product.
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/access/product.rb', line 11 def initialize(values) @used_fields = [] set_up_methods(values) set_values(values) @offer = Access::Offer.new(@offer) if @offer @offer_store = Access::Store.new(@offer_store) if @offer_store @categories = Access::Category.process_batch(@categories) if @categories @links = Access::Link.new(@links) if @links @offer_store = Access::Store.new(@offer_store) if @offer_store @offer_uses_remaining = Access::Redemption.new(@offer_uses_remaining) if @offer_uses_remaining end |
Instance Attribute Details
#location ⇒ Object (readonly)
Returns the value of attribute location.
5 6 7 |
# File 'lib/access/product.rb', line 5 def location @location end |
#store ⇒ Object (readonly)
Returns the value of attribute store.
5 6 7 |
# File 'lib/access/product.rb', line 5 def store @store end |
Class Method Details
.process_batch(chunk) ⇒ Object
7 8 9 |
# File 'lib/access/product.rb', line 7 def self.process_batch(chunk) chunk.map { |product| new(product) } end |