Class: Capybara::PomPom::TableRow

Inherits:
Struct
  • Object
show all
Includes:
Finder
Defined in:
lib/capybara/pompom/table_row.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Finder

#button, #component, #components, #css, #field, included, #link, #table

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/capybara/pompom/table_row.rb', line 5

def method_missing(name, *args)
  if self.finders.has_key?(name)
    return self.finders[name].get(row)
  end

  super
end

Instance Attribute Details

#rowObject

Returns the value of attribute row

Returns:

  • (Object)

    the current value of row



2
3
4
# File 'lib/capybara/pompom/table_row.rb', line 2

def row
  @row
end

Class Method Details

.column(name, options) ⇒ Object



13
14
15
# File 'lib/capybara/pompom/table_row.rb', line 13

def self.column(name, options)
  self.finders[name] = ElementFinder.new(:find, "td:nth-child(#{options.fetch(:at_index)})")
end