class Tychus::Parsers::SimpleParser
going to look for an 'ingredient' class and retrieve elements
Public Class Methods
strategies()
click to toggle source
# File lib/tychus/parsers/simple_parser.rb, line 5 def self.strategies %i[ :ingredient_class_search ] end
Public Instance Methods
ingredient_class_search()
click to toggle source
# File lib/tychus/parsers/simple_parser.rb, line 10 def ingredient_class_search ingredients = doc.css('.ingredient') ingredients.map do |node| node.content .squeeze(" ") .rstrip .lstrip .split("\r\n") end.flatten end