Class: Druid::Elements::Table
- Defined in:
- lib/druid/elements/table.rb
Instance Attribute Summary
Attributes inherited from Element
Instance Method Summary collapse
-
#[](idx) ⇒ Druid::Elements::Table
Return the Druid::Elements::Table for the index provided.
- #each ⇒ Object
-
#first_row ⇒ Object
return the first row.
-
#last_row ⇒ Object
return the last row.
-
#rows ⇒ Object
Returns the number of rows in the table.
Methods inherited from Element
#==, #attribute, #clear, #click, #disabled?, #double_click, #enabled?, #exist?, #fire_event, #flash, #focus, identifier_for, #initialize, #inspect, #method_missing, #parent, #right_click, #send_keys, #style, #tag_name, #text, #value, #visible?, #wait_until, #when_not_present, #when_not_visible, #when_present, #when_visible
Methods included from Assist
#button_for, #buttons_for, #cell_for, #cell_text_for, #cells_for, #check_checkbox, #checkbox_checked?, #checkbox_for, #checkboxes_for, #clear_radio, #click_button_for, #click_link_for, #div_for, #div_text_for, #divs_for, #element_for, #file_field_for, #file_field_value_set, #file_fields_for, #form_for, #forms_for, #h1_for, #h1_text_for, #h1s_for, #h2_for, #h2_text_for, #h2s_for, #h3_for, #h3_text_for, #h3s_for, #h4_for, #h4_text_for, #h4s_for, #h5_for, #h5_text_for, #h5s_for, #h6_for, #h6_text_for, #h6s_for, #hidden_field_for, #hidden_field_value_for, #hidden_fields_for, #image_for, #images_for, #label_for, #label_text_for, #labels_for, #link_for, #links_for, #list_item_for, #list_item_text_for, #list_items_for, #ordered_list_for, #ordered_lists_for, #paragraph_for, #paragraph_text_for, #paragraphs_for, #radio_button_for, #radio_buttons_for, #radio_selected?, #select_list_for, #select_list_value_for, #select_list_value_set, #select_lists_for, #select_radio, #span_for, #span_text_for, #spans_for, #table_for, #tables_for, #text_area_for, #text_area_value_for, #text_area_value_set, #text_areas_for, #text_field_for, #text_field_value_for, #text_field_value_set, #text_fields_for, #uncheck_checkbox, #unordered_list_for, #unordered_lists_for
Methods included from NestedElements
#button_element, #button_elements, #cell_element, #cell_elements, #checkbox_element, #checkbox_elements, #div_element, #div_elements, #file_field_element, #form_element, #form_elements, #h1_element, #h1_elements, #h2_element, #h2_elements, #h3_element, #h3_elements, #h4_element, #h4_elements, #h5_element, #h5_elements, #h6_element, #h6_elements, #hidden_field_element, #hidden_field_elements, #image_element, #image_elements, #label_element, #label_elements, #link_element, #link_elements, #list_item_element, #list_item_elements, #ordered_list_element, #ordered_list_elements, #paragraph_element, #paragraph_elements, #radio_button_element, #radio_button_elements, #select_list_element, #select_list_elements, #span_element, #span_elements, #table_element, #table_elements, #text_area_element, #text_area_elements, #text_field_element, #text_field_elements, #unordered_list_element, #unordered_list_elements
Constructor Details
This class inherits a constructor from Druid::Elements::Element
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Druid::Elements::Element
Instance Method Details
#[](idx) ⇒ Druid::Elements::Table
Return the Druid::Elements::Table for the index provided. Index is zero based. If the index provided is a String then it will be matched with the text from any column. The text can be a substring of the full column text.
12 13 14 15 16 |
# File 'lib/druid/elements/table.rb', line 12 def [](idx) idx = find_index_by_title(idx) if idx.kind_of?(String) return nil unless idx Druid::Elements::TableRow.new(element[idx]) end |
#each ⇒ Object
24 25 26 27 28 |
# File 'lib/druid/elements/table.rb', line 24 def each for index in 1..self.rows do yield self[index-1] end end |
#first_row ⇒ Object
return the first row
35 36 37 |
# File 'lib/druid/elements/table.rb', line 35 def first_row self[0] end |
#last_row ⇒ Object
return the last row
44 45 46 |
# File 'lib/druid/elements/table.rb', line 44 def last_row self[-1] end |
#rows ⇒ Object
Returns the number of rows in the table.
20 21 22 |
# File 'lib/druid/elements/table.rb', line 20 def rows element.rows.size end |