Class: Locator::Element::ElementsList

Inherits:
Locator::Element show all
Defined in:
lib/locator/element/elements_list.rb

Direct Known Subclasses

Button, Field

Instance Attribute Summary collapse

Attributes inherited from Locator::Element

#attributes, #css, #locatables, #name

Instance Method Summary collapse

Methods inherited from Locator::Element

#all, #locate, #xpath

Constructor Details

#initialize(*elements) ⇒ ElementsList

Returns a new instance of ElementsList.



6
7
8
# File 'lib/locator/element/elements_list.rb', line 6

def initialize(*elements)
  @elements = elements
end

Instance Attribute Details

#elementsObject (readonly)

Returns the value of attribute elements.



4
5
6
# File 'lib/locator/element/elements_list.rb', line 4

def elements
  @elements
end

Instance Method Details

#lookup(dom, selector, attributes) ⇒ Object



10
11
12
# File 'lib/locator/element/elements_list.rb', line 10

def lookup(dom, selector, attributes)
  Result.new(elements.map { |element| element.send(:lookup, dom, selector, attributes) }.flatten)
end