Class: CapybaraPageObject::Table

Inherits:
Element show all
Defined in:
lib/capybara-page-object/elements/table.rb

Instance Attribute Summary

Attributes inherited from Node

#source

Instance Method Summary collapse

Methods included from HTML5Data

#data

Methods included from Collections

#key, #value

Methods inherited from Node

#classes, element, field, from_string, #initialize

Methods included from Delegators

#all, #find, #text

Constructor Details

This class inherits a constructor from CapybaraPageObject::Node

Instance Method Details

#headersObject



11
12
13
14
15
16
# File 'lib/capybara-page-object/elements/table.rb', line 11

def headers
  all('th').each_with_object({}) do |e, hash|
    th = CapybaraPageObject::TableHeader.new(e)
    hash[th.key] = th
  end
end

#rowsObject



3
4
5
6
7
8
9
# File 'lib/capybara-page-object/elements/table.rb', line 3

def rows
  all('tr').each_with_object({}) do |e, hash|
    tr = CapybaraPageObject::TableRow.new(e)
    next if tr.header?
    hash[tr.key] = tr
  end
end