Class: Selenium::WebDriver::Edge::Options
- Inherits:
-
Object
- Object
- Selenium::WebDriver::Edge::Options
- Defined in:
- lib/selenium/webdriver/edge/options.rb
Instance Attribute Summary collapse
-
#extension_paths ⇒ Object
readonly
Returns the value of attribute extension_paths.
-
#in_private ⇒ Object
Returns the value of attribute in_private.
-
#start_page ⇒ Object
Returns the value of attribute start_page.
Instance Method Summary collapse
-
#add_extension_path(path) ⇒ Object
Add an extension by local path.
- #as_json ⇒ Object private
-
#initialize(**opts) ⇒ Options
constructor
Create a new Options instance for Edge.
Constructor Details
#initialize(**opts) ⇒ Options
Create a new Options instance for Edge.
42 43 44 45 46 |
# File 'lib/selenium/webdriver/edge/options.rb', line 42 def initialize(**opts) @in_private = opts.delete(:in_private) || false @extension_paths = opts.delete(:extension_paths) || [] @start_page = opts.delete(:start_page) end |
Instance Attribute Details
#extension_paths ⇒ Object (readonly)
Returns the value of attribute extension_paths.
25 26 27 |
# File 'lib/selenium/webdriver/edge/options.rb', line 25 def extension_paths @extension_paths end |
#in_private ⇒ Object
Returns the value of attribute in_private.
24 25 26 |
# File 'lib/selenium/webdriver/edge/options.rb', line 24 def in_private @in_private end |
#start_page ⇒ Object
Returns the value of attribute start_page.
24 25 26 |
# File 'lib/selenium/webdriver/edge/options.rb', line 24 def start_page @start_page end |
Instance Method Details
#add_extension_path(path) ⇒ Object
Add an extension by local path.
58 59 60 61 62 |
# File 'lib/selenium/webdriver/edge/options.rb', line 58 def add_extension_path(path) raise Error::WebDriverError, "could not find extension at #{path.inspect}" unless File.directory?(path) @extension_paths << path end |
#as_json ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
68 69 70 71 72 73 74 75 76 |
# File 'lib/selenium/webdriver/edge/options.rb', line 68 def as_json(*) opts = {} opts['ms:inPrivate'] = true if @in_private opts['ms:extensionPaths'] = @extension_paths if @extension_paths.any? opts['ms:startPage'] = @start_page if @start_page opts end |