Class: Api::Taxjar::TaxResult

Inherits:
Data
  • Object
show all
Defined in:
app/services/api/taxjar/tax_result.rb

Overview

A POST /v2/taxes response — only the fields Taxes::GetTaxRate reads.
line_items flattens the gem's breakdown.line_items (empty when the
order has no nexus / isn't taxable, matching the old nil-safe access).

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(rate: nil, freight_taxable: false, line_items: []) ⇒ TaxResult

Returns a new instance of TaxResult.



9
# File 'app/services/api/taxjar/tax_result.rb', line 9

def initialize(rate: nil, freight_taxable: false, line_items: []) = super

Instance Attribute Details

#freight_taxableObject (readonly)

Returns the value of attribute freight_taxable

Returns:

  • (Object)

    the current value of freight_taxable



8
9
10
# File 'app/services/api/taxjar/tax_result.rb', line 8

def freight_taxable
  @freight_taxable
end

#line_itemsObject (readonly)

Returns the value of attribute line_items

Returns:

  • (Object)

    the current value of line_items



8
9
10
# File 'app/services/api/taxjar/tax_result.rb', line 8

def line_items
  @line_items
end

#rateObject (readonly)

Returns the value of attribute rate

Returns:

  • (Object)

    the current value of rate



8
9
10
# File 'app/services/api/taxjar/tax_result.rb', line 8

def rate
  @rate
end