Class: Workarea::Orderbot::ChildProduct
- Inherits:
-
Object
- Object
- Workarea::Orderbot::ChildProduct
- Includes:
- Filters
- Defined in:
- app/services/workarea/orderbot/child_product.rb
Defined Under Namespace
Classes: ChildProductImportError, NoParentProductImportError
Instance Attribute Summary collapse
-
#child_product ⇒ Object
readonly
Returns the value of attribute child_product.
Instance Method Summary collapse
-
#initialize(child_product) ⇒ ChildProduct
constructor
A new instance of ChildProduct.
- #process ⇒ Object
Methods included from Filters
#add_filter_values, #first_variable, #second_variable
Constructor Details
#initialize(child_product) ⇒ ChildProduct
Returns a new instance of ChildProduct.
10 11 12 |
# File 'app/services/workarea/orderbot/child_product.rb', line 10 def initialize(child_product) @child_product = child_product end |
Instance Attribute Details
#child_product ⇒ Object (readonly)
Returns the value of attribute child_product.
8 9 10 |
# File 'app/services/workarea/orderbot/child_product.rb', line 8 def child_product @child_product end |
Instance Method Details
#process ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'app/services/workarea/orderbot/child_product.rb', line 14 def process raise ChildProductImportError, "Blank Sku for #{product_id}" if sku.blank? raise NoParentProductImportError, "No product found for #{product_id}" if product.blank? save_variant save_price save_shipping_sku set_product_filters end |