Class: CapybaraPageObject::Table

Inherits:
Node
  • Object
show all
Defined in:
lib/element/table.rb

Instance Attribute Summary

Attributes inherited from Node

#source

Instance Method Summary collapse

Methods inherited from Node

#classes, from_string, #initialize

Methods included from HTML5Data

#data

Methods included from Collections

#forms, #key, #tables, #value

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/element/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/element/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