123456789_123456789_123456789_123456789_123456789_

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

Class Method Summary

Instance Method Summary

Constructor Details

.new(locator) ⇒ RelativeLocator

[ GitHub ]

  
# 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