Class: WatirNokogiri::TableRowCollection

Inherits:
ElementCollection show all
Defined in:
lib/watir-nokogiri/elements/table_row.rb,
lib/watir-nokogiri/elements/generated.rb

Overview

TableRow

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from ElementCollection

#[], #each, #first, #initialize, #last, #length, #to_a

Constructor Details

This class inherits a constructor from WatirNokogiri::ElementCollection

Instance Attribute Details

#locator_classObject



42
43
44
# File 'lib/watir-nokogiri/elements/table_row.rb', line 42

def locator_class
  @locator_class || super
end

Instance Method Details

#element_classObject



334
335
336
# File 'lib/watir-nokogiri/elements/generated.rb', line 334

def element_class
  TableRow
end

#elementsObject



28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/watir-nokogiri/elements/table_row.rb', line 28

def elements
  # we do this craziness since the xpath used will find direct child rows
  # before any rows inside thead/tbody/tfoot...
  elements = super

  if locator_class == ChildRowLocator and @parent.kind_of? Table
    # This sorting will not do anything since nokogiri does not know the rowIndex
    # BUG: https://github.com/jkotests/watir-nokogiri/issues/1
    elements = elements.sort_by { |row| row.get_attribute(:rowIndex).to_i }
  end

  elements
end