Class: Spree::ShippingRateTax
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Spree::ShippingRateTax
- Extended by:
- DisplayMoney
- Defined in:
- app/models/spree/shipping_rate_tax.rb
Overview
Used to persist shipping rate tax estimations.
Instance Attribute Summary collapse
-
#shipping_rate ⇒ Spree::ShippingRate
The shipping rate to be taxed.
-
#tax_rate ⇒ Spree::TaxRate
The tax rate used to calculate the tax amount.
Instance Method Summary collapse
Methods included from DisplayMoney
Instance Attribute Details
#shipping_rate ⇒ Spree::ShippingRate
The shipping rate to be taxed
7 8 9 |
# File 'app/models/spree/shipping_rate_tax.rb', line 7 def shipping_rate @shipping_rate end |
#tax_rate ⇒ Spree::TaxRate
The tax rate used to calculate the tax amount
7 8 9 |
# File 'app/models/spree/shipping_rate_tax.rb', line 7 def tax_rate @tax_rate end |
Instance Method Details
#absolute_amount ⇒ Object
23 24 25 |
# File 'app/models/spree/shipping_rate_tax.rb', line 23 def absolute_amount amount.abs end |
#label ⇒ Object
16 17 18 19 20 21 |
# File 'app/models/spree/shipping_rate_tax.rb', line 16 def label Spree.t translation_key, scope: 'shipping_rate_tax.label', amount: display_absolute_amount, tax_rate_name: tax_rate.name end |