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



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

def initialize(browser_options)
  @browser_options = browser_options
  @session = Session.new(browser_options)
end

Instance Attribute Details

#browser_optionsObject (readonly)

Returns the value of attribute browser_options.



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

def browser_options
  @browser_options
end

#sessionObject

Returns the value of attribute session.



9
10
11
# File 'lib/chemlab/runtime/browser.rb', line 9

def session
  @session
end

Class Method Details



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

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

Instance Method Details



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

def navigate_to(path)
  @session ||= Chemlab.configuration.browser.session
  @session.engine.goto(Chemlab.configuration.base_url + path)
end