Module: Hangry

Defined in:
lib/hangry.rb,
lib/hangry/version.rb,
lib/hangry/recipe_parser.rb,
lib/hangry/hrecipe_parser.rb,
lib/hangry/canonical_url_parser.rb,
lib/hangry/default_recipe_parser.rb,
lib/hangry/parser_class_selecter.rb,
lib/hangry/recipe_attribute_cleaner.rb,
lib/hangry/schema_org_recipe_parser.rb,
lib/hangry/data_vocabulary_recipe_parser.rb,
lib/hangry/parsers/non_standard/all_recipes_parser.rb,
lib/hangry/parsers/non_standard/eating_well_parser.rb,
lib/hangry/parsers/non_standard/taste_of_home_parser.rb

Defined Under Namespace

Modules: Parsers Classes: CanonicalUrlParser, DataVocabularyRecipeParser, DefaultRecipeParser, HRecipeParser, ParserClassSelecter, Recipe, RecipeAttributeCleaner, RecipeParser, SchemaOrgRecipeParser

Constant Summary collapse

RECIPE_ATTRIBUTES =
[
  :author,
  :canonical_url,
  :cook_time,
  :description,
  :image_url,
  :ingredients,
  :instructions,
  :name,
  :nutrition,
  :prep_time,
  :published_date,
  :total_time,
  :yield
]
NUTRITION_ATTRIBUTES =
[
  :calories,
  :cholesterol,
  :fiber,
  :protein,
  :saturated_fat,
  :sodium,
  :sugar,
  :total_carbohydrates,
  :total_fat,
  :trans_fat,
  :unsaturated_fat
]
VERSION =
"0.0.13"

Class Method Summary collapse

Class Method Details

.parse(html) ⇒ Object



42
43
44
45
46
# File 'lib/hangry.rb', line 42

def self.parse(html)
  parser_class = ParserClassSelecter.new(html).parser_class
  recipe = parser_class.new(html).parse
  RecipeAttributeCleaner.new(recipe).clean
end