class Selenium::WebDriver::DevTools::PinnedScript

Attributes

devtools_identifier[RW]
key[RW]
script[RW]

Public Class Methods

new(script) click to toggle source
# File lib/selenium/webdriver/devtools/pinned_script.rb, line 26
def initialize(script)
  @key = SecureRandom.alphanumeric
  @script = script
end

Public Instance Methods

callable() click to toggle source

@api private

# File lib/selenium/webdriver/devtools/pinned_script.rb, line 35
def callable
  "function __webdriver_#{key}(arguments) { #{script} }"
end
remove() click to toggle source

@api private

# File lib/selenium/webdriver/devtools/pinned_script.rb, line 51
def remove
  "__webdriver_#{key} = undefined"
end
to_json(*) click to toggle source

@api private

# File lib/selenium/webdriver/devtools/pinned_script.rb, line 43
def to_json(*)
  %{"return __webdriver_#{key}(arguments)"}
end