Class: BrowserInterface
- Inherits:
-
Watir::Safari
- Object
- Watir::Safari
- BrowserInterface
- Defined in:
- lib/auto_bidder/browser_interface.rb
Instance Method Summary collapse
-
#initialize(url) ⇒ BrowserInterface
constructor
A new instance of BrowserInterface.
- #reload ⇒ Object
Constructor Details
#initialize(url) ⇒ BrowserInterface
Returns a new instance of BrowserInterface.
3 4 5 6 7 8 9 10 11 12 13 |
# File 'lib/auto_bidder/browser_interface.rb', line 3 def initialize(url) super() @url = url begin goto @url rescue $log.error "Failed to load website. Will retry." retry end end |
Instance Method Details
#reload ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/auto_bidder/browser_interface.rb', line 15 def reload $log.debug "reloading ..." begin goto @url @last_reload = Time.now.to_i sleep 5 # give the browser time to finish loading before continuing rescue $log.error "Failed to reload. Will retry." retry end end |