Class: PageObject::Elements::Table
- Includes:
- Enumerable
- Defined in:
- lib/page-object/elements/table.rb
Instance Attribute Summary
Attributes inherited from Element
Instance Method Summary collapse
-
#each ⇒ PageObject::Elements::TableRow
iterator that yields with a PageObject::Elements::TableRow.
-
#first_row ⇒ Object
return the first row.
-
#initialize(element, platform) ⇒ Table
constructor
A new instance of Table.
-
#last_row ⇒ Object
return the last row.
Methods inherited from Element
#class_name, #click, #disabled?, #enabled?, #inspect, #method_missing, plural_form, selenium_identifier_for, #style, watir_identifier_for
Methods included from NestedElements
Constructor Details
permalink #initialize(element, platform) ⇒ Table
Returns a new instance of Table.
7 8 9 10 |
# File 'lib/page-object/elements/table.rb', line 7 def initialize(element, platform) @element = element include_platform_for platform end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class PageObject::Elements::Element
Instance Method Details
permalink #each ⇒ PageObject::Elements::TableRow
iterator that yields with a PageObject::Elements::TableRow
17 18 19 20 21 |
# File 'lib/page-object/elements/table.rb', line 17 def each for index in 1..self.rows do yield self[index-1] end end |
permalink #first_row ⇒ Object
return the first row
28 29 30 |
# File 'lib/page-object/elements/table.rb', line 28 def first_row self[0] end |
permalink #last_row ⇒ Object
return the last row
37 38 39 |
# File 'lib/page-object/elements/table.rb', line 37 def last_row self[-1] end |