Class: TaxCloud::CartItem

Inherits:
Object
  • Object
show all
Defined in:
lib/cartitem.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#indexObject

Returns the value of attribute index.



6
7
8
# File 'lib/cartitem.rb', line 6

def index
  @index
end

#item_idObject

Returns the value of attribute item_id.



6
7
8
# File 'lib/cartitem.rb', line 6

def item_id
  @item_id
end

#priceObject

Returns the value of attribute price.



6
7
8
# File 'lib/cartitem.rb', line 6

def price
  @price
end

#quantityObject

Returns the value of attribute quantity.



6
7
8
# File 'lib/cartitem.rb', line 6

def quantity
  @quantity
end

#ticObject

Returns the value of attribute tic.



6
7
8
# File 'lib/cartitem.rb', line 6

def tic
  @tic
end

Instance Method Details

#to_hashObject



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