Class: Selenium::WebDriver::DevTools::PinnedScript
- Inherits:
-
Object
- Object
- Selenium::WebDriver::DevTools::PinnedScript
- Defined in:
- lib/selenium/webdriver/devtools/pinned_script.rb
Instance Attribute Summary collapse
-
#devtools_identifier ⇒ Object
Returns the value of attribute devtools_identifier.
-
#key ⇒ Object
Returns the value of attribute key.
-
#script ⇒ Object
Returns the value of attribute script.
Instance Method Summary collapse
- #callable ⇒ Object private
-
#initialize(script) ⇒ PinnedScript
constructor
A new instance of PinnedScript.
- #remove ⇒ Object private
- #to_json ⇒ Object private
Constructor Details
#initialize(script) ⇒ PinnedScript
Returns a new instance of PinnedScript.
27 28 29 30 |
# File 'lib/selenium/webdriver/devtools/pinned_script.rb', line 27 def initialize(script) @key = SecureRandom.alphanumeric @script = script end |
Instance Attribute Details
#devtools_identifier ⇒ Object
Returns the value of attribute devtools_identifier.
25 26 27 |
# File 'lib/selenium/webdriver/devtools/pinned_script.rb', line 25 def devtools_identifier @devtools_identifier end |
#key ⇒ Object
Returns the value of attribute key.
25 26 27 |
# File 'lib/selenium/webdriver/devtools/pinned_script.rb', line 25 def key @key end |
#script ⇒ Object
Returns the value of attribute script.
25 26 27 |
# File 'lib/selenium/webdriver/devtools/pinned_script.rb', line 25 def script @script end |
Instance Method Details
#callable ⇒ 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.
36 37 38 |
# File 'lib/selenium/webdriver/devtools/pinned_script.rb', line 36 def callable "function __webdriver_#{key}(arguments) { #{script} }" end |
#remove ⇒ 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.
52 53 54 |
# File 'lib/selenium/webdriver/devtools/pinned_script.rb', line 52 def remove "__webdriver_#{key} = undefined" end |
#to_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.
44 45 46 |
# File 'lib/selenium/webdriver/devtools/pinned_script.rb', line 44 def to_json(*) %{"return __webdriver_#{key}(arguments)"} end |