Class: TaxCloud::CartItemsResponse
- Inherits:
-
Object
- Object
- TaxCloud::CartItemsResponse
- Defined in:
- lib/response/cart_items_response.rb
Instance Attribute Summary collapse
-
#cart_item_response ⇒ Object
Array of cart_item_response.
Instance Method Summary collapse
- #get_taxes(cart_item_index) ⇒ Object
-
#initialize(attrs = {}) ⇒ CartItemsResponse
constructor
A new instance of CartItemsResponse.
Constructor Details
#initialize(attrs = {}) ⇒ CartItemsResponse
Returns a new instance of CartItemsResponse.
6 7 8 |
# File 'lib/response/cart_items_response.rb', line 6 def initialize(attrs = {}) @cart_item_response = attrs[:cart_item_response] end |
Instance Attribute Details
#cart_item_response ⇒ Object
Array of cart_item_response
4 5 6 |
# File 'lib/response/cart_items_response.rb', line 4 def cart_item_response @cart_item_response end |
Instance Method Details
#get_taxes(cart_item_index) ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/response/cart_items_response.rb', line 10 def get_taxes(cart_item_index) # the response may or may not be an array if !cart_item_response[cart_item_index].nil? taxes = cart_item_response[cart_item_index][:tax_amount] else taxes = cart_item_response[:tax_amount] end end |