Class: Spree::ShipmentHandler
Class Method Summary
collapse
Instance Method Summary
collapse
#store_integration, #store_integrations
#send_shipped_email
Constructor Details
19
20
21
|
# File 'app/models/spree/shipment_handler.rb', line 19
def initialize(shipment)
@shipment = shipment
end
|
Class Method Details
.factory(shipment) ⇒ Object
7
8
9
10
11
12
13
14
15
16
|
# File 'app/models/spree/shipment_handler.rb', line 7
def factory(shipment)
if sm_handler = "Spree::ShipmentHandler::#{shipment.shipping_method.name.split('::').last}".safe_constantize
sm_handler.new(shipment)
else
new(shipment)
end
end
|
Instance Method Details
23
24
25
26
27
28
29
|
# File 'app/models/spree/shipment_handler.rb', line 23
def perform
@shipment.inventory_units.each &:ship!
@shipment.process_order_payments if Spree::Config[:auto_capture_on_dispatch]
@shipment.touch :shipped_at
update_order_shipment_state
send_shipped_email
end
|