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.


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

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.


8
9
10
# File 'lib/watir/locators/element/matcher.rb', line 8

def query_scope
  @query_scope
end

#selectorObject (readonly)

Returns the value of attribute selector.


8
9
10
# File 'lib/watir/locators/element/matcher.rb', line 8

def selector
  @selector
end

Instance Method Details

#match(elements, values_to_match, filter) ⇒ Object


15
16
17
18
# File 'lib/watir/locators/element/matcher.rb', line 15

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