Class: Akatus::Product
- Inherits:
-
Object
- Object
- Akatus::Product
- Defined in:
- lib/akatus/product.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
Returns the value of attribute code.
-
#discount_amount ⇒ Object
Returns the value of attribute discount_amount.
-
#freight_amount ⇒ Object
Returns the value of attribute freight_amount.
-
#name ⇒ Object
Returns the value of attribute name.
-
#price ⇒ Object
Returns the value of attribute price.
-
#quantity ⇒ Object
Returns the value of attribute quantity.
-
#weight ⇒ Object
Returns the value of attribute weight.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Product
constructor
A new instance of Product.
Constructor Details
#initialize(attributes = {}) ⇒ Product
Returns a new instance of Product.
5 6 7 8 9 |
# File 'lib/akatus/product.rb', line 5 def initialize(attributes = {}) attributes.each do |name, value| send("#{name}=", value) end end |
Instance Attribute Details
#code ⇒ Object
Returns the value of attribute code.
3 4 5 |
# File 'lib/akatus/product.rb', line 3 def code @code end |
#discount_amount ⇒ Object
Returns the value of attribute discount_amount.
3 4 5 |
# File 'lib/akatus/product.rb', line 3 def discount_amount @discount_amount end |
#freight_amount ⇒ Object
Returns the value of attribute freight_amount.
3 4 5 |
# File 'lib/akatus/product.rb', line 3 def freight_amount @freight_amount end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/akatus/product.rb', line 3 def name @name end |
#price ⇒ Object
Returns the value of attribute price.
3 4 5 |
# File 'lib/akatus/product.rb', line 3 def price @price end |
#quantity ⇒ Object
Returns the value of attribute quantity.
3 4 5 |
# File 'lib/akatus/product.rb', line 3 def quantity @quantity end |
#weight ⇒ Object
Returns the value of attribute weight.
3 4 5 |
# File 'lib/akatus/product.rb', line 3 def weight @weight end |