Class: Spree::Tax::ItemTax

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Model
Defined in:
app/models/spree/tax/item_tax.rb

Overview

Simple object used to hold tax data for an item.

This generic object will hold the amount of tax that should be applied to an item. (Either a LineItem or a Shipment.)

Instance Attribute Summary collapse

Instance Attribute Details

#amountBigDecimal

the amount of tax applied to the item

Returns:

  • (BigDecimal)

    the current value of amount



15
16
17
# File 'app/models/spree/tax/item_tax.rb', line 15

def amount
  @amount
end

#included_in_priceBoolean

whether the amount is included in the items price, or additional tax.

Returns:

  • (Boolean)

    the current value of included_in_price



15
16
17
# File 'app/models/spree/tax/item_tax.rb', line 15

def included_in_price
  @included_in_price
end

#item_idInteger

the LineItem or Shipment ID

Returns:

  • (Integer)

    the current value of item_id



15
16
17
# File 'app/models/spree/tax/item_tax.rb', line 15

def item_id
  @item_id
end

#labelString

information about the taxes

Returns:

  • (String)

    the current value of label



15
16
17
# File 'app/models/spree/tax/item_tax.rb', line 15

def label
  @label
end

#tax_rateSpree::TaxRate

will be used as the source for tax adjustments

Returns:



15
16
17
# File 'app/models/spree/tax/item_tax.rb', line 15

def tax_rate
  @tax_rate
end