Class: Kentaa::Api::Resources::OrderItem

Inherits:
Object
  • Object
show all
Defined in:
lib/kentaa/api/resources/order_item.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#dataObject (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

#amountObject



24
25
26
# File 'lib/kentaa/api/resources/order_item.rb', line 24

def amount
  BigDecimal(data[:amount])
end

#currencyObject



28
29
30
# File 'lib/kentaa/api/resources/order_item.rb', line 28

def currency
  data[:currency]
end

#productObject



16
17
18
# File 'lib/kentaa/api/resources/order_item.rb', line 16

def product
  Kentaa::Api::Resources::Product.new(data[:product])
end

#quantityObject



20
21
22
# File 'lib/kentaa/api/resources/order_item.rb', line 20

def quantity
  data[:quantity]
end