Class: Kentaa::Api::Resources::Product
- Inherits:
-
Object
- Object
- Kentaa::Api::Resources::Product
- Defined in:
- lib/kentaa/api/resources/product.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
- #currency ⇒ Object
- #id ⇒ Object
-
#initialize(data) ⇒ Product
constructor
A new instance of Product.
- #price ⇒ Object
- #title ⇒ Object
- #variant_id ⇒ Object
- #variant_title ⇒ Object
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
#data ⇒ Object (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
#currency ⇒ Object
36 37 38 |
# File 'lib/kentaa/api/resources/product.rb', line 36 def currency data[:currency] end |
#id ⇒ Object
16 17 18 |
# File 'lib/kentaa/api/resources/product.rb', line 16 def id data[:id] end |
#price ⇒ Object
32 33 34 |
# File 'lib/kentaa/api/resources/product.rb', line 32 def price BigDecimal(data[:price]) end |
#title ⇒ Object
20 21 22 |
# File 'lib/kentaa/api/resources/product.rb', line 20 def title data[:title] end |
#variant_id ⇒ Object
24 25 26 |
# File 'lib/kentaa/api/resources/product.rb', line 24 def variant_id data[:variant_id] end |
#variant_title ⇒ Object
28 29 30 |
# File 'lib/kentaa/api/resources/product.rb', line 28 def variant_title data[:variant_title] end |