Class: Spree::ShippingRateTax Private

Inherits:
ActiveRecord::Base
  • Object
show all
Extended by:
DisplayMoney
Defined in:
app/models/spree/shipping_rate_tax.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.

Used to persist shipping rate tax estimations.

See Also:

Since:

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Methods included from DisplayMoney

money_methods

Instance Attribute Details

- (Spree::ShippingRate) shipping_rate

The shipping rate to be taxed

Returns:



7
8
9
# File 'app/models/spree/shipping_rate_tax.rb', line 7

def shipping_rate
  @shipping_rate
end

- (Spree::TaxRate) tax_rate

The tax rate used to calculate the tax amount

Returns:



7
8
9
# File 'app/models/spree/shipping_rate_tax.rb', line 7

def tax_rate
  @tax_rate
end

Instance Method Details

- (Object) absolute_amount

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.

Since:

  • 1.3.0



23
24
25
# File 'app/models/spree/shipping_rate_tax.rb', line 23

def absolute_amount
  amount.abs
end

- (Object) label

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.

Since:

  • 1.3.0



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