Class: Workarea::Pricing::ItemTaxApplier

Inherits:
Object
  • Object
show all
Includes:
TaxApplication
Defined in:
app/models/workarea/pricing/item_tax_applier.rb

Instance Method Summary collapse

Methods included from TaxApplication

#calculate_tax_amount, #calculate_tax_amounts

Methods included from GuardNegativePrice

#guard_negative_price

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

#applyObject



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