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

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

Direct Known Subclasses

TextField::Matcher

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of Matcher.


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

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


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

def query_scope
  @query_scope
end

#selectorObject (readonly)

Returns the value of attribute selector


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

def selector
  @selector
end

Instance Method Details

#match(elements, values_to_match, filter) ⇒ Object


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

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