Class: IngredientParser::Ingredient
- Inherits:
-
Object
- Object
- IngredientParser::Ingredient
- Defined in:
- lib/ingredient_parser/ingredient.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name, amount) ⇒ Ingredient
constructor
A new instance of Ingredient.
Constructor Details
#initialize(name, amount) ⇒ Ingredient
Returns a new instance of Ingredient.
4 5 6 7 |
# File 'lib/ingredient_parser/ingredient.rb', line 4 def initialize(name, amount) @name = normalize(name) @amount = normalize(amount) end |
Instance Attribute Details
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
3 4 5 |
# File 'lib/ingredient_parser/ingredient.rb', line 3 def amount @amount end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/ingredient_parser/ingredient.rb', line 3 def name @name end |