Class: IngredientParser::Ingredient

Inherits:
Object
  • Object
show all
Defined in:
lib/ingredient_parser/ingredient.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#amountObject (readonly)

Returns the value of attribute amount.



3
4
5
# File 'lib/ingredient_parser/ingredient.rb', line 3

def amount
  @amount
end

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/ingredient_parser/ingredient.rb', line 3

def name
  @name
end