Class: VertexClient::Response::LineItem
- Inherits:
-
Object
- Object
- VertexClient::Response::LineItem
- Defined in:
- lib/vertex_client/responses/line_item.rb
Instance Attribute Summary collapse
-
#price ⇒ Object
readonly
Returns the value of attribute price.
-
#product ⇒ Object
readonly
Returns the value of attribute product.
-
#quantity ⇒ Object
readonly
Returns the value of attribute quantity.
-
#total_tax ⇒ Object
readonly
Returns the value of attribute total_tax.
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ LineItem
constructor
A new instance of LineItem.
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
#price ⇒ Object (readonly)
Returns the value of attribute price.
5 6 7 |
# File 'lib/vertex_client/responses/line_item.rb', line 5 def price @price end |
#product ⇒ Object (readonly)
Returns the value of attribute product.
5 6 7 |
# File 'lib/vertex_client/responses/line_item.rb', line 5 def product @product end |
#quantity ⇒ Object (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_tax ⇒ Object (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 |