Class: TaxCloud::CartItem
- Inherits:
-
Object
- Object
- TaxCloud::CartItem
- Defined in:
- lib/cartitem.rb
Instance Attribute Summary collapse
-
#index ⇒ Object
Returns the value of attribute index.
-
#item_id ⇒ Object
Returns the value of attribute item_id.
-
#price ⇒ Object
Returns the value of attribute price.
-
#quantity ⇒ Object
Returns the value of attribute quantity.
-
#tic ⇒ Object
Returns the value of attribute tic.
Instance Method Summary collapse
-
#initialize(attrs = {}) ⇒ CartItem
constructor
A new instance of CartItem.
- #to_hash ⇒ Object
Constructor Details
#initialize(attrs = {}) ⇒ CartItem
Returns a new instance of CartItem.
8 9 10 11 12 |
# File 'lib/cartitem.rb', line 8 def initialize(attrs = {}) attrs.each do |sym, val| self.send "#{sym}=", val end end |
Instance Attribute Details
#index ⇒ Object
Returns the value of attribute index.
6 7 8 |
# File 'lib/cartitem.rb', line 6 def index @index end |
#item_id ⇒ Object
Returns the value of attribute item_id.
6 7 8 |
# File 'lib/cartitem.rb', line 6 def item_id @item_id end |
#price ⇒ Object
Returns the value of attribute price.
6 7 8 |
# File 'lib/cartitem.rb', line 6 def price @price end |
#quantity ⇒ Object
Returns the value of attribute quantity.
6 7 8 |
# File 'lib/cartitem.rb', line 6 def quantity @quantity end |
#tic ⇒ Object
Returns the value of attribute tic.
6 7 8 |
# File 'lib/cartitem.rb', line 6 def tic @tic end |
Instance Method Details
#to_hash ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/cartitem.rb', line 14 def to_hash { 'Index' => index, 'ItemID' => item_id, 'TIC' => tic, 'Price' => price, 'Qty' => quantity } end |