Class: Kentaa::Api::Resources::OrderItem
- Inherits:
-
Object
- Object
- Kentaa::Api::Resources::OrderItem
- Defined in:
- lib/kentaa/api/resources/order_item.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
- #amount ⇒ Object
- #currency ⇒ Object
-
#initialize(data) ⇒ OrderItem
constructor
A new instance of OrderItem.
- #product ⇒ Object
- #quantity ⇒ Object
Constructor Details
#initialize(data) ⇒ OrderItem
Returns a new instance of OrderItem.
12 13 14 |
# File 'lib/kentaa/api/resources/order_item.rb', line 12 def initialize(data) @data = data end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
10 11 12 |
# File 'lib/kentaa/api/resources/order_item.rb', line 10 def data @data end |
Instance Method Details
#amount ⇒ Object
24 25 26 |
# File 'lib/kentaa/api/resources/order_item.rb', line 24 def amount BigDecimal(data[:amount]) end |
#currency ⇒ Object
28 29 30 |
# File 'lib/kentaa/api/resources/order_item.rb', line 28 def currency data[:currency] end |
#product ⇒ Object
16 17 18 |
# File 'lib/kentaa/api/resources/order_item.rb', line 16 def product Kentaa::Api::Resources::Product.new(data[:product]) end |
#quantity ⇒ Object
20 21 22 |
# File 'lib/kentaa/api/resources/order_item.rb', line 20 def quantity data[:quantity] end |