Method: EwayRapid::Models::LineItem#calculate
- Defined in:
- lib/eway_rapid/models/models.rb
#calculate(unit_cost, unit_tax, quantity) ⇒ Object
Set the line item’s values so that the total and tax add up correctly
110 111 112 113 114 115 |
# File 'lib/eway_rapid/models/models.rb', line 110 def calculate(unit_cost, unit_tax, quantity) if unit_cost && unit_tax && quantity tax = unit_tax * quantity quantity * unit_cost + tax end end |