123456789_123456789_123456789_123456789_123456789_

Class: Selenium::WebDriver::ShadowRoot

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Instance Chain:
Inherits: Object
Defined in: rb/lib/selenium/webdriver/common/shadow_root.rb

Constant Summary

SearchContext - Included

FINDERS

Class Method Summary

Instance Attribute Summary

Instance Method Summary

SearchContext - Included

#find_element

Find the first element matching the given arguments.

#find_elements

Find all elements matching the given arguments.

#extract_args

Constructor Details

.new(bridge, id) ⇒ ShadowRoot

This method is for internal use only.

Creates a new shadow root

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/common/shadow_root.rb', line 33

def initialize(bridge, id)
  @bridge = bridge
  @id = id
end

Instance Attribute Details

#bridge (readonly, private)

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/common/shadow_root.rb', line 83

attr_reader :bridge

Instance Method Details

#==(other) Also known as: #eql?

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/common/shadow_root.rb', line 42

def ==(other)
  other.is_a?(self.class) && ref == other.ref
end

#as_json

This method is for internal use only.
[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/common/shadow_root.rb', line 77

def as_json(*)
  {ROOT_KEY => @id}
end

#eql?(other)

Alias for #==.

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/common/shadow_root.rb', line 45

alias eql? ==

#hash

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/common/shadow_root.rb', line 47

def hash
  [@id, @bridge].hash
end

#inspect

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/common/shadow_root.rb', line 38

def inspect
  format '#<%<class>s:0x%<hash>x id=%<id>s>', class: self.class, hash: hash * 2, id: @id.inspect
end

#ref

This method is for internal use only.

See Also:

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/common/shadow_root.rb', line 56

def ref
  [:shadow_root, @id]
end

#to_json

This method is for internal use only.

Convert to a ShadowRoot JSON Object for transmission over the wire.

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/common/shadow_root.rb', line 67

def to_json(*)
  JSON.generate as_json
end