Class: Spree::Tax::OrderAdjuster Private
- Inherits:
-
Object
- Object
- Spree::Tax::OrderAdjuster
- 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
- #order ⇒ Object readonly private
Instance Method Summary collapse
-
#adjust! ⇒ Object
private
Creates tax adjustments for all taxable items (shipments and line items) in the given order.
-
#initialize(order) ⇒ OrderAdjuster
constructor
private
A new instance of OrderAdjuster.
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.
10 11 12 |
# File 'app/models/spree/tax/order_adjuster.rb', line 10 def initialize(order) @order = order end |
Instance Attribute Details
#order ⇒ Object (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, ).adjust! end end |