123456789_123456789_123456789_123456789_123456789_

Class: Selenium::WebDriver::DevTools::PinnedScript

Relationships & Source Files
Inherits: Object
Defined in: rb/lib/selenium/webdriver/devtools/pinned_script.rb

Class Method Summary

Instance Attribute Summary

Instance Method Summary

  • #callable Internal use only Internal use only
  • #remove Internal use only Internal use only
  • #to_json Internal use only Internal use only

Constructor Details

.new(script) ⇒ PinnedScript

[ GitHub ]

  
# 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 (rw)

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/devtools/pinned_script.rb', line 24

attr_accessor :key, :devtools_identifier, :script

#key (rw)

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/devtools/pinned_script.rb', line 24

attr_accessor :key, :devtools_identifier, :script

#script (rw)

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/devtools/pinned_script.rb', line 24

attr_accessor :key, :devtools_identifier, :script

Instance Method Details

#callable

This method is for internal use only.
[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/devtools/pinned_script.rb', line 35

def callable
  "function __webdriver_#{key}(arguments) { #{script} }"
end

#remove

This method is for internal use only.
[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/devtools/pinned_script.rb', line 51

def remove
  "__webdriver_#{key} = undefined"
end

#to_json

This method is for internal use only.
[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/devtools/pinned_script.rb', line 43

def to_json(*)
  %{"return __webdriver_#{key}(arguments)"}
end