Class: Crabfarm::BaseParser
- Inherits:
-
Delegator
- Object
- Delegator
- Crabfarm::BaseParser
- Defined in:
- lib/crabfarm/base_parser.rb
Instance Attribute Summary collapse
-
#browser ⇒ Object
readonly
Returns the value of attribute browser.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Class Method Summary collapse
Instance Method Summary collapse
- #__getobj__ ⇒ Object
- #__setobj__(obj) ⇒ Object
-
#initialize(_driver, _params) ⇒ BaseParser
constructor
A new instance of BaseParser.
- #parse ⇒ Object
Constructor Details
#initialize(_driver, _params) ⇒ BaseParser
Returns a new instance of BaseParser.
10 11 12 13 14 15 16 |
# File 'lib/crabfarm/base_parser.rb', line 10 def initialize(_driver, _params) dsl_class = Strategies.load(:browser_dsl, class_browser_dsl || Crabfarm.config.browser_dsl) @browser = dsl_class.wrap _driver @params = _params super @browser end |
Instance Attribute Details
#browser ⇒ Object (readonly)
Returns the value of attribute browser.
4 5 6 |
# File 'lib/crabfarm/base_parser.rb', line 4 def browser @browser end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
4 5 6 |
# File 'lib/crabfarm/base_parser.rb', line 4 def params @params end |
Class Method Details
.browser_dsl(_dsl) ⇒ Object
6 7 8 |
# File 'lib/crabfarm/base_parser.rb', line 6 def self.browser_dsl(_dsl) @browser_dsl = _dsl end |
Instance Method Details
#__getobj__ ⇒ Object
22 23 24 |
# File 'lib/crabfarm/base_parser.rb', line 22 def __getobj__ @browser end |
#__setobj__(obj) ⇒ Object
26 27 28 |
# File 'lib/crabfarm/base_parser.rb', line 26 def __setobj__(obj) @browser = obj end |
#parse ⇒ Object
18 19 20 |
# File 'lib/crabfarm/base_parser.rb', line 18 def parse raise NotImplementedError.new end |