Class: Selenium::WebDriver::Firefox::Preference

Inherits:
Object
  • Object
show all
Defined in:
lib/firefox_prefs.rb

Overview

representation of a firefox pref

Constant Summary collapse

PREF_TYPES =
{ 'PREF_BOOL' => 128, 'PREF_INT' => 64, 'PREF_INVALID' => 0, 'PREF_STRING' => 32 }.freeze
GET_METHODS =
{ 0 => 'getStringPref', 32 => 'getStringPref', 64 => 'getIntPref', 128 => 'getBoolPref' }.freeze
SET_METHODS =
{ 32 => 'setStringPref', 64 => 'setIntPref', 128 => 'setBoolPref' }.freeze

Instance Method Summary collapse

Constructor Details

#initialize(driver) ⇒ Preference

Returns a new instance of Preference.



14
15
16
# File 'lib/firefox_prefs.rb', line 14

def initialize(driver)
  @driver = driver
end

Instance Method Details

#[](str) ⇒ Object



18
19
20
# File 'lib/firefox_prefs.rb', line 18

def [](str)
  @driver.execute_script_in_chrome_context script_string(str)
end

#[]=(str, val) ⇒ Object



22
23
24
# File 'lib/firefox_prefs.rb', line 22

def []=(str, val)
  @driver.execute_script_in_chrome_context script_string(str, val)
end