Class: Selenium::WebDriver::DevTools::PinnedScript
- Inherits:
-
Object
- Object
- Selenium::WebDriver::DevTools::PinnedScript
- Defined in:
- rb/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.
26 27 28 29 |
# File 'rb/lib/selenium/webdriver/devtools/pinned_script.rb', line 26 def initialize(script) @key = SecureRandom.alphanumeric @script = script end |
Instance Attribute Details
#devtools_identifier ⇒ Object
Returns the value of attribute devtools_identifier.
24 25 26 |
# File 'rb/lib/selenium/webdriver/devtools/pinned_script.rb', line 24 def devtools_identifier @devtools_identifier end |
#key ⇒ Object
Returns the value of attribute key.
24 25 26 |
# File 'rb/lib/selenium/webdriver/devtools/pinned_script.rb', line 24 def key @key end |
#script ⇒ Object
Returns the value of attribute script.
24 25 26 |
# File 'rb/lib/selenium/webdriver/devtools/pinned_script.rb', line 24 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.
35 36 37 |
# File 'rb/lib/selenium/webdriver/devtools/pinned_script.rb', line 35 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.
51 52 53 |
# File 'rb/lib/selenium/webdriver/devtools/pinned_script.rb', line 51 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.
43 44 45 |
# File 'rb/lib/selenium/webdriver/devtools/pinned_script.rb', line 43 def to_json(*) %{"return __webdriver_#{key}(arguments)"} end |