Class: Basilisk::TermsProcessor
- Inherits:
-
CSVProcessor
- Object
- Processor
- CSVProcessor
- Basilisk::TermsProcessor
- Defined in:
- lib/basilisk/processors/terms_processor.rb
Overview
Stores page errors.
Instance Method Summary collapse
-
#initialize(search_name, regex_terms, css_terms) ⇒ TermsProcessor
constructor
A new instance of TermsProcessor.
- #process_page(page, page_hash) ⇒ Object
Methods inherited from CSVProcessor
Methods inherited from Processor
Constructor Details
#initialize(search_name, regex_terms, css_terms) ⇒ TermsProcessor
Returns a new instance of TermsProcessor.
5 6 7 8 9 10 |
# File 'lib/basilisk/processors/terms_processor.rb', line 5 def initialize(search_name, regex_terms, css_terms) super(search_name) @regex_terms = regex_terms @css_terms = css_terms save_header_row end |
Instance Method Details
#process_page(page, page_hash) ⇒ Object
12 13 14 15 16 |
# File 'lib/basilisk/processors/terms_processor.rb', line 12 def process_page(page, page_hash) regexes = match_regexes(page.doc) css_terms = match_css_terms(page.doc) write_row(page, regexes, css_terms) if !regexes.empty? || !css_terms.empty? end |