Class: Panier::Domain::Product
- Inherits:
-
Object
- Object
- Panier::Domain::Product
- Defined in:
- lib/panier/domain/product.rb
Overview
A product is a purchasable item with a price and one or more tax classes that allow taxes to be calculated accurately.
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#price ⇒ Object
Returns the value of attribute price.
-
#tax_classes ⇒ Object
Returns the value of attribute tax_classes.
Instance Method Summary collapse
-
#initialize(name, price, tax_classes = []) ⇒ Product
constructor
Initializes the product using the given name, price and optional tax classes.
Constructor Details
#initialize(name, price, tax_classes = []) ⇒ Product
Initializes the product using the given name, price and optional tax classes.
21 22 23 24 25 |
# File 'lib/panier/domain/product.rb', line 21 def initialize(name, price, tax_classes = []) @name = name self.price = price @tax_classes = tax_classes end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
10 11 12 |
# File 'lib/panier/domain/product.rb', line 10 def name @name end |
#price ⇒ Object
Returns the value of attribute price.
11 12 13 |
# File 'lib/panier/domain/product.rb', line 11 def price @price end |
#tax_classes ⇒ Object
Returns the value of attribute tax_classes.
10 11 12 |
# File 'lib/panier/domain/product.rb', line 10 def tax_classes @tax_classes end |