Class: Chemlab::Runtime::Browser

Inherits:
Object
  • Object
show all
Extended by:
SingleForwardable
Includes:
ActiveSupport::Configurable
Defined in:
lib/chemlab/runtime/browser.rb

Overview

The browser configurator

Defined Under Namespace

Classes: Session

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(browser_options) ⇒ Browser

Returns a new instance of Browser.



14
15
16
# File 'lib/chemlab/runtime/browser.rb', line 14

def initialize(browser_options)
  @browser_options = browser_options
end

Instance Attribute Details

#browser_optionsObject (readonly)

Returns the value of attribute browser_options.



12
13
14
# File 'lib/chemlab/runtime/browser.rb', line 12

def browser_options
  @browser_options
end

#sessionObject

Returns the value of attribute session.



11
12
13
# File 'lib/chemlab/runtime/browser.rb', line 11

def session
  @session
end

Class Method Details



18
19
20
# File 'lib/chemlab/runtime/browser.rb', line 18

def self.navigate_to(page_class)
  Chemlab.configuration.browser.navigate_to(page_class.url)
end

Instance Method Details



22
23
24
25
# File 'lib/chemlab/runtime/browser.rb', line 22

def navigate_to(url)
  @session = Chemlab.configuration.browser.session ||= Session.new(url, browser_options)
  @session.engine.goto(Chemlab.configuration.base_url + url)
end