class Kitchen::Selector

A wrapper for a selector. Can be used as the default_css_or_xpath.

Attributes

name[R]

Public Class Methods

named(name) click to toggle source
# File lib/kitchen/selector.rb, line 9
def self.named(name)
  @instances ||= {}
  @instances[name] ||= new(name) { |config| config.selectors.send(name) }
end
new(name, &block) click to toggle source
Calls superclass method
# File lib/kitchen/selector.rb, line 14
def initialize(name, &block)
  @name = name
  super(&block)
end

Public Instance Methods

matches?(node, config:) click to toggle source
# File lib/kitchen/selector.rb, line 19
def matches?(node, config:)
  # This may not be incredibly efficient as it does a search of this node's
  # ancestors to see if the node is in the results.  Watch the performance.
  node.quick_matches?(call(config))
end