Module: IngredientParser

Extended by:
IngredientParser
Included in:
IngredientParser
Defined in:
lib/ingredient_parser.rb,
lib/ingredient_parser/parser.rb,
lib/ingredient_parser/version.rb,
lib/ingredient_parser/ingredient.rb

Defined Under Namespace

Classes: Ingredient, Parser

Constant Summary collapse

VERSION =
"0.1.0"

Class Method Summary collapse

Class Method Details

.parse(str) ⇒ Object



22
23
24
25
# File 'lib/ingredient_parser.rb', line 22

def self.parse(str)
  parsed = @parser.parse(str)
  Ingredient.new(parsed[:name], parsed[:amount])
end