Class: Prodamus::Product
- Inherits:
-
Object
- Object
- Prodamus::Product
- Defined in:
- lib/entities/product.rb
Overview
Some product to be sent to prodamus
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#price ⇒ Object
readonly
Returns the value of attribute price.
-
#quantity ⇒ Object
readonly
Returns the value of attribute quantity.
-
#sku ⇒ Object
readonly
Returns the value of attribute sku.
Instance Method Summary collapse
-
#initialize(name:, price:, quantity: 1, sku: nil) ⇒ Product
constructor
A new instance of Product.
Constructor Details
#initialize(name:, price:, quantity: 1, sku: nil) ⇒ Product
Returns a new instance of Product.
10 11 12 13 14 15 |
# File 'lib/entities/product.rb', line 10 def initialize(name:, price:, quantity: 1, sku: nil) @sku = sku.to_s @name = name @price = price.to_s @quantity = quantity.to_s end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/entities/product.rb', line 8 def name @name end |
#price ⇒ Object (readonly)
Returns the value of attribute price.
8 9 10 |
# File 'lib/entities/product.rb', line 8 def price @price end |
#quantity ⇒ Object (readonly)
Returns the value of attribute quantity.
8 9 10 |
# File 'lib/entities/product.rb', line 8 def quantity @quantity end |
#sku ⇒ Object (readonly)
Returns the value of attribute sku.
8 9 10 |
# File 'lib/entities/product.rb', line 8 def sku @sku end |