Class: Scraper::Parser::Base
- Inherits:
-
Object
- Object
- Scraper::Parser::Base
- Defined in:
- lib/scraper/parser/base.rb
Overview
Base class which controls the base parser operations
Direct Known Subclasses
Instance Attribute Summary (collapse)
-
- (Object) data
readonly
Parsed IMEI info.
Instance Method Summary (collapse)
-
- (Nokogiri::HTML::Document) doc
Nokogiri document.
-
- (Hash) parse(page)
Parse the page.
Instance Attribute Details
- (Object) data (readonly)
Parsed IMEI info
8 9 10 |
# File 'lib/scraper/parser/base.rb', line 8 def data @data end |
Instance Method Details
- (Nokogiri::HTML::Document) doc
Nokogiri document
32 33 34 |
# File 'lib/scraper/parser/base.rb', line 32 def doc @doc ||= Nokogiri::HTML(@page) end |
- (Hash) parse(page)
Parse the page
18 19 20 21 22 23 24 25 |
# File 'lib/scraper/parser/base.rb', line 18 def parse(page) @page = page reset_data methods.grep(/^parse_/).each { |m| send(m) } after_parse data end |