Class: SolidusDrip::ShopperActivity::Product
- Defined in:
- lib/solidus_drip/shopper_activity/product.rb
Instance Attribute Summary collapse
-
#variant ⇒ Object
Returns the value of attribute variant.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(variant) ⇒ Product
constructor
ShopperActivity::Product relies on Spree::Variant data to be useful.
-
#product_activity(action) ⇒ Object
Product Activity helps identify variant updates.
Constructor Details
#initialize(variant) ⇒ Product
ShopperActivity::Product relies on Spree::Variant data to be useful. We call super to initialize the client and then we set the variant attribute to be used in the API calls.
15 16 17 18 |
# File 'lib/solidus_drip/shopper_activity/product.rb', line 15 def initialize(variant) super @variant = variant end |
Instance Attribute Details
#variant ⇒ Object
Returns the value of attribute variant.
6 7 8 |
# File 'lib/solidus_drip/shopper_activity/product.rb', line 6 def variant @variant end |
Instance Method Details
#product_activity(action) ⇒ Object
Product Activity helps identify variant updates.
26 27 28 29 30 31 |
# File 'lib/solidus_drip/shopper_activity/product.rb', line 26 def product_activity(action) response = client.create_product_activity_event(product_data(action)) handle_error_response(response) if !response.success? response.success? end |