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.net/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.



17
18
19
20
# File 'lib/tax_cloud/responses/cart_item.rb', line 17

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

Instance Attribute Details

#cart_item_indexObject

The index of the cart item.



10
11
12
# File 'lib/tax_cloud/responses/cart_item.rb', line 10

def cart_item_index
  @cart_item_index
end

#tax_amountObject

Tax amount for this cart item.



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

def tax_amount
  @tax_amount
end