Class: Workarea::Pricing::ItemTaxApplier
- Inherits:
-
Object
- Object
- Workarea::Pricing::ItemTaxApplier
- Includes:
- TaxApplication
- Defined in:
- app/models/workarea/pricing/item_tax_applier.rb
Instance Method Summary collapse
- #apply ⇒ Object
-
#initialize(address, adjustments_to_tax) ⇒ ItemTaxApplier
constructor
A new instance of ItemTaxApplier.
Methods included from TaxApplication
#calculate_tax_amount, #calculate_tax_amounts
Methods included from GuardNegativePrice
Constructor Details
#initialize(address, adjustments_to_tax) ⇒ ItemTaxApplier
Returns a new instance of ItemTaxApplier.
6 7 8 9 10 |
# File 'app/models/workarea/pricing/item_tax_applier.rb', line 6 def initialize(address, adjustments_to_tax) @address = address @adjustments_to_tax = adjustments_to_tax @adjustments_by_parent = adjustments_to_tax.grouped_by_parent end |
Instance Method Details
#apply ⇒ Object
12 13 14 |
# File 'app/models/workarea/pricing/item_tax_applier.rb', line 12 def apply @adjustments_to_tax.each { |adjustment| assign_item_tax(adjustment) } end |