Class: SolidusImporter::Processors::Variant

Inherits:
Base
  • Object
show all
Defined in:
lib/solidus_importer/processors/variant.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#options

Instance Attribute Details

#productObject

Returns the value of attribute product.



6
7
8
# File 'lib/solidus_importer/processors/variant.rb', line 6

def product
  @product
end

Instance Method Details

#call(context) ⇒ Object



8
9
10
11
12
13
# File 'lib/solidus_importer/processors/variant.rb', line 8

def call(context)
  @data = context.fetch(:data)
  self.product = context.fetch(:product) || raise(ArgumentError, 'missing :product in context')

  context.merge!(variant: process_variant)
end