Class: Pages
- Inherits:
-
Object
- Object
- Pages
- Defined in:
- lib/whv_nz/pages.rb
Instance Attribute Summary collapse
-
#driver ⇒ Object
readonly
Returns the value of attribute driver.
Instance Method Summary collapse
-
#initialize(data, config, logger) ⇒ Pages
constructor
A new instance of Pages.
- #open_page(page) ⇒ Object
Constructor Details
#initialize(data, config, logger) ⇒ Pages
Returns a new instance of Pages.
7 8 9 10 11 12 13 14 |
# File 'lib/whv_nz/pages.rb', line 7 def initialize(data, config, logger) ENV["DISPLAY"] = ":10" @driver = Selenium::WebDriver.for(:chrome, detach: false) @data = data @config = config @logger = logger end |
Instance Attribute Details
#driver ⇒ Object (readonly)
Returns the value of attribute driver.
5 6 7 |
# File 'lib/whv_nz/pages.rb', line 5 def driver @driver end |
Instance Method Details
#open_page(page) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/whv_nz/pages.rb', line 16 def open_page(page) @logger.info("Start(page): " + page) send page @logger.info("Finish(page): " + page) rescue Net::ReadTimeout => e @logger.error(e) .error(e) retry end |