Class: CapybaraPageObject::Table
- Defined in:
- lib/capybara-page-object/elements/table.rb
Instance Attribute Summary
Attributes inherited from Node
Instance Method Summary collapse
Methods included from HTML5Data
Methods included from Collections
Methods inherited from Node
#classes, element, field, from_string, #initialize
Methods included from Delegators
Constructor Details
This class inherits a constructor from CapybaraPageObject::Node
Instance Method Details
#headers ⇒ Object
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 |
#rows ⇒ Object
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 |