This is an ingredients markdown for converting pure text into recipe objects for use on cooking websites.
EXAMPLES
Example usage;
tc = TableCloth::Recipe.new(:ingredients => “3 cups of sugar”)
tc.ingredients.first.quantity
=> "3"
tc.ingredients.first.unit
=> :cup
tc.ingredients.first.item
=> "sugar"
All of the following forms of ingredient text will also parse;
"2lbs Potatoes" "2 lbs Potatoes" "2 lb Potatoes" "2lb Potatoes" "1 tablespoon of sugar" "1 bouquet garni" "a cup of sugar" "salt to taste"
You can also parse each ingredient back into a readable English string;
tb = TableCloth::Recipe.new(:ingredients => “1 cups sugar”) tb.ingredients.first.to_s
=> "1 cup of sugar"
tb = TableCloth.new(“2 cup sugar”) tb.ingredients.first.to_s
=> "2 cups of sugar"
You can also generate html from the various parts of the object;
tc.ingredients.to_html