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.



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

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

Instance Attribute Details

#cart_item_indexObject

The index of the cart item.



8
9
10
# File 'lib/tax_cloud/responses/cart_item.rb', line 8

def cart_item_index
  @cart_item_index
end

#tax_amountObject

Tax amount for this cart item.



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

def tax_amount
  @tax_amount
end