Class: TaxCloud::Responses::CartItem

Inherits:
Object
  • Object
show all
Defined in:
lib/tax_cloud/responses/cart_item.rb

Overview

A single item in the response to a TaxCloud Lookup API call.

See api.taxcloud.com/1.0/TaxCloud.asmx?op=Lookup.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(savon_response) ⇒ CartItem

Parameters

savon_response

SOAP response.



19
20
21
22
# File 'lib/tax_cloud/responses/cart_item.rb', line 19

def initialize(savon_response)
  self.cart_item_index = savon_response[:cart_item_index].to_i
  self.tax_amount = BigDecimal(savon_response[:tax_amount])
end

Instance Attribute Details

#cart_item_indexObject

The index of the cart item.



12
13
14
# File 'lib/tax_cloud/responses/cart_item.rb', line 12

def cart_item_index
  @cart_item_index
end

#tax_amountObject

Tax amount for this cart item.



15
16
17
# File 'lib/tax_cloud/responses/cart_item.rb', line 15

def tax_amount
  @tax_amount
end