Sha256: ce1671e6becf1f35087149a68731411b4f4de13997846f9f0e2d26ec2375f61d
Contents?: true
Size: 798 Bytes
Versions: 6
Compression:
Stored size: 798 Bytes
Contents
module Hangry class DataVocabularyRecipeParser < SchemaOrgRecipeParser def self.root_selector '[itemtype="http://data-vocabulary.org/Recipe"]' end def self.nutrition_selector '[itemtype="http://data-vocabulary.org/NutritionInformation"]' end def self.ingredient_itemprop :ingredient end private def parse_description clean_string node_with_itemprop(:summary).content end def parse_instructions clean_string node_with_itemprop(:instructions).content, preserve_newlines: true end def parse_published_date content = node_with_itemprop(:published).content content.blank? ? nil : Date.parse(content) end def parse_yield clean_string node_with_itemprop(:yield).content end end end
Version data entries
6 entries across 6 versions & 1 rubygems