Class: Selenium::WebDriver::Support::RelativeLocator Private
Do not use. This class is for internal use only.
Relationships & Source Files | |
Inherits: | Object |
Defined in: | rb/lib/selenium/webdriver/support/relative_locator.rb |
Constant Summary
-
KEYS =
# File 'rb/lib/selenium/webdriver/support/relative_locator.rb', line 28%w[above below left right near distance].freeze
Class Method Summary
- .new(locator) ⇒ RelativeLocator constructor Internal use only
Instance Method Summary
- #as_json Internal use only
Constructor Details
.new(locator) ⇒ RelativeLocator
# File 'rb/lib/selenium/webdriver/support/relative_locator.rb', line 30
def initialize(locator) @filters, @root = locator.partition { |how, _| KEYS.include?(how) }.map(&:to_h) end
Instance Method Details
#as_json
[ GitHub ]# File 'rb/lib/selenium/webdriver/support/relative_locator.rb', line 34
def as_json { relative: { root: @root, filters: @filters.map do |kind, filter| { kind: kind, args: [filter] } end } } end