Class: BrowserInterface

Inherits:
Watir::Safari
  • Object
show all
Defined in:
lib/auto_bidder/browser_interface.rb

Instance Method Summary collapse

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

#reloadObject



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