Sha256: 749a9dc15028837d93b159c8684e3d0221bbf7d838880bc627f94986b044cfbf
Contents?: true
Size: 805 Bytes
Versions: 1
Compression:
Stored size: 805 Bytes
Contents
require 'hangry/recipe_parser' require 'hangry/default_recipe_parser' require 'hangry/hrecipe_parser' require 'hangry/schema_org_recipe_parser' require 'hangry/data_vocabulary_recipe_parser' require 'hangry/parsers/non_standard/all_recipes_parser' require 'hangry/parsers/non_standard/eating_well_parser' module Hangry class ParserClassSelecter def initialize(html) @html = html end def parser_class # Prefer the more specific parsers parser_classes = [ Parsers::NonStandard::AllRecipesParser, Parsers::NonStandard::EatingWellParser ] parser_classes += [SchemaOrgRecipeParser, HRecipeParser, DataVocabularyRecipeParser] parser_classes << DefaultRecipeParser parser_classes.detect { |p| p.can_parse?(@html) } end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
hangry-0.0.11 | lib/hangry/parser_class_selecter.rb |