Class: Watir::Locators::Element::Matcher

Inherits:
Object
  • Object
show all
Includes:
Exception, JSSnippets
Defined in:
lib/watir/locators/element/matcher.rb

Direct Known Subclasses

TextField::Matcher

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from JSSnippets

#execute_js

Constructor Details

#initialize(query_scope, selector = {}) ⇒ Matcher

Returns a new instance of Matcher.



12
13
14
15
# File 'lib/watir/locators/element/matcher.rb', line 12

def initialize(query_scope, selector = {})
  @query_scope = query_scope
  @selector = selector
end

Instance Attribute Details

#query_scopeObject (readonly)

Returns the value of attribute query_scope.



10
11
12
# File 'lib/watir/locators/element/matcher.rb', line 10

def query_scope
  @query_scope
end

#selectorObject (readonly)

Returns the value of attribute selector.



10
11
12
# File 'lib/watir/locators/element/matcher.rb', line 10

def selector
  @selector
end

Instance Method Details

#match(elements, values_to_match, filter) ⇒ Object



17
18
19
20
# File 'lib/watir/locators/element/matcher.rb', line 17

def match(elements, values_to_match, filter)
  elements = matching_labels(elements, values_to_match)
  matching_elements(elements, values_to_match, filter: filter)
end