class Gamera::PageSections::TableRow
Default class used to represent a row in a table
Public Class Methods
new(row_css, headers)
click to toggle source
@param row_css [String] The css selector for the row @param headers [Array] An array of the strings from the tables header row
Calls superclass method
# File lib/gamera/page_sections/table.rb, line 222 def initialize(row_css, headers) super(row_css) headers.each_with_index do |header, i| cell_name = header.downcase.tr(' ', '_').gsub(/[^a-z0-9_]+/, '') self.class.send(:define_method, cell_name) do find("td:nth-child(#{i + 1})").text end end end