Class: Kentaa::Api::Resources::Product

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Product

Returns a new instance of Product.



12
13
14
# File 'lib/kentaa/api/resources/product.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/product.rb', line 10

def data
  @data
end

Instance Method Details

#currencyObject



36
37
38
# File 'lib/kentaa/api/resources/product.rb', line 36

def currency
  data[:currency]
end

#idObject



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

def id
  data[:id]
end

#priceObject



32
33
34
# File 'lib/kentaa/api/resources/product.rb', line 32

def price
  BigDecimal(data[:price])
end

#titleObject



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

def title
  data[:title]
end

#variant_idObject



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

def variant_id
  data[:variant_id]
end

#variant_titleObject



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

def variant_title
  data[:variant_title]
end