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/schema_org_recipe_parser.rb,
lib/hangry/data_vocabulary_recipe_parser.rb,
lib/hangry/parsers/non_standard/all_recipes_parser.rb

Defined Under Namespace

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

Constant Summary collapse

RECIPE_ATTRIBUTES =
[
  :author,
  :canonical_url,
  :cook_time,
  :description,
  :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.10"

Class Method Summary collapse

Class Method Details

.parse(html) ⇒ Object



40
41
42
43
# File 'lib/hangry.rb', line 40

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