lib/yasf/scraper.rb in yasf-0.0.3 vs lib/yasf/scraper.rb in yasf-0.0.4
- old
+ new
@@ -127,17 +127,22 @@
# Returns the document being processed.
def document
@document
end
+ # Called by #scrape before calling #result typically used to run post-processing steps
+ def collect()
+ end
+
# Scrapes the document and returns the result.
def extract
rules = self.class.rules.clone
rules.delete_if do |selector, extractor, rule_name|
document.search(selector).each do |element|
extractor.bind(self).call(element)
end
end
+ collect
return result
end
end
end