Class: Spree::Tax::OrderAdjuster Private

Inherits:
Object
  • Object
show all
Includes:
TaxHelpers
Defined in:
app/models/spree/tax/order_adjuster.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Add tax adjustments to all line items and shipments in an order

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(order) ⇒ OrderAdjuster

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of OrderAdjuster

Parameters:



10
11
12
# File 'app/models/spree/tax/order_adjuster.rb', line 10

def initialize(order)
  @order = order
end

Instance Attribute Details

#orderObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



5
6
7
# File 'app/models/spree/tax/order_adjuster.rb', line 5

def order
  @order
end

Instance Method Details

#adjust!Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Creates tax adjustments for all taxable items (shipments and line items) in the given order.



16
17
18
19
20
# File 'app/models/spree/tax/order_adjuster.rb', line 16

def adjust!
  (order.line_items + order.shipments).each do |item|
    ItemAdjuster.new(item, order_wide_options).adjust!
  end
end