Class: SolidusImporter::Processors::Shipment

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#options

Instance Attribute Details

#orderObject

Returns the value of attribute order.



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

def order
  @order
end

Instance Method Details

#call(context) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'lib/solidus_importer/processors/shipment.rb', line 8

def call(context)
  @data = context.fetch(:data)

  self.order = context.fetch(:order, {})
  order[:shipments_attributes] ||= []
  order[:shipments_attributes] << shipments_attributes

  context.merge!(order: order)
end