Class: VertexClient::Response::LineItem

Inherits:
Object
  • Object
show all
Defined in:
lib/vertex_client/responses/line_item.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ LineItem

Returns a new instance of LineItem.



7
8
9
10
11
12
# File 'lib/vertex_client/responses/line_item.rb', line 7

def initialize(params={})
  @product        = params[:product]
  @quantity       = params[:quantity] ? params[:quantity].to_i : 0
  @price          = BigDecimal.new(params[:price] || 0)
  @total_tax      = BigDecimal.new(params[:total_tax] || 0)
end

Instance Attribute Details

#priceObject (readonly)

Returns the value of attribute price.



5
6
7
# File 'lib/vertex_client/responses/line_item.rb', line 5

def price
  @price
end

#productObject (readonly)

Returns the value of attribute product.



5
6
7
# File 'lib/vertex_client/responses/line_item.rb', line 5

def product
  @product
end

#quantityObject (readonly)

Returns the value of attribute quantity.



5
6
7
# File 'lib/vertex_client/responses/line_item.rb', line 5

def quantity
  @quantity
end

#total_taxObject (readonly)

Returns the value of attribute total_tax.



5
6
7
# File 'lib/vertex_client/responses/line_item.rb', line 5

def total_tax
  @total_tax
end