Class: RoRoSupport::Watir::ElementCollection

Inherits:
Object
  • Object
show all
Defined in:
lib/roro_support/watir/element_collection.rb

Instance Method Summary collapse

Instance Method Details

#collect(*selectors) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/roro_support/watir/element_collection.rb', line 4

def collect *selectors
  if selectors.size == 2
    result = Hash.new
    self.each do |tag|
      result[tag.attribute(selectors[0]).to_sym] = tag.attribute selectors[1]
    end
  else
    result = Array.new
    self.each do |tag|
      result[tag.attribute selector[0]] = tag.attribute selector[1]
    end

  end
  result
end