Class: Watir::RowCollection

Inherits:
TableRowCollection show all
Defined in:
lib/watir/elements/row.rb

Instance Method Summary collapse

Methods inherited from ElementCollection

#==, #[], #browser, #build, #each, #first, #initialize, #last, #locate

Methods included from Locators::ClassHelpers

#class_from_string, #element_class_name, #element_matcher_class, #locator, #locator_class, #selector_builder, #selector_builder_class

Methods included from JSSnippets

#execute_js

Constructor Details

This class inherits a constructor from Watir::ElementCollection

Instance Method Details

#to_aObject


10
11
12
13
14
# File 'lib/watir/elements/row.rb', line 10

def to_a
  # we do this craziness since the xpath used will find direct child rows
  # before any rows inside thead/tbody/tfoot...
  @to_a ||= super.sort_by { |e| e.attribute_value(:rowIndex).to_i }
end