Class: Watir::TableBodies
Overview
this class is a collection of the table body objects that exist in the table it wouldnt normally be created by a user, but gets returned by the bodies method of the Table object many of the methods available to this object are inherited from the Element class
Constant Summary
Constants inherited from Element
Instance Attribute Summary
Attributes inherited from Element
Attributes included from Container
#activeObjectHighLightColor, #page_container, #type_keys, #typingspeed
Instance Method Summary collapse
-
#[](n) ⇒ Object
returns the n’th Body as a Watir TableBody object.
-
#each ⇒ Object
iterates through each of the TableBodies in the Table.
-
#initialize(container, parent_table) ⇒ TableBodies
constructor
A new instance of TableBodies.
-
#length ⇒ Object
returns the number of TableBodies that exist in the table.
-
#ole_table_body_at_index(n) ⇒ Object
returns an ole table body.
Methods inherited from Element
#<=>, #activeObjectHighLightColor, #after_text, #assert_enabled, #assert_exists, #attribute_value, #before_text, #click, #click!, #document, #enabled?, #exists?, #fire_event, #flash, #focus, #inspect, #method_missing, #ole_object, #ole_object=, #parent, #text, #to_s, #type_keys, #typingspeed, #visible?
Methods included from Container
#area, #areas, #button, #buttons, #cell, #cells, #checkbox, #checkboxes, #dds, #divs, #dls, #dts, #element, #element_by_css, #elements, #ems, #file_field, #file_fields, #form, #forms, #frame, #frames, #hidden, #hiddens, #image, #images, #labels, #link, #links, #lis, #locate_all_elements, #locate_input_element, #locate_tagged_element, #log, #map, #maps, #modal_dialog, #popup, #pres, #ps, #radio, #radios, #row, #rows, #select_list, #select_lists, #set_container, #show_all_objects, #spans, #strongs, #table, #tables, #text_field, #text_fields, #wait
Constructor Details
#initialize(container, parent_table) ⇒ TableBodies
Returns a new instance of TableBodies.
183 184 185 186 |
# File 'lib/watir/table.rb', line 183 def initialize(container, parent_table) set_container container @o = parent_table # in this case, @o is the parent table end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Watir::Element
Instance Method Details
#[](n) ⇒ Object
returns the n’th Body as a Watir TableBody object
195 196 197 198 |
# File 'lib/watir/table.rb', line 195 def []n assert_exists return TableBody.new(@container, :ole_object, ole_table_body_at_index(n)) end |
#each ⇒ Object
iterates through each of the TableBodies in the Table. Yields a TableBody object
206 207 208 209 210 |
# File 'lib/watir/table.rb', line 206 def each 1.upto(@o.tBodies.length) do |i| yield TableBody.new(@container, :ole_object, ole_table_body_at_index(i)) end end |
#length ⇒ Object
returns the number of TableBodies that exist in the table
189 190 191 192 |
# File 'lib/watir/table.rb', line 189 def length assert_exists return @o.tBodies.length end |
#ole_table_body_at_index(n) ⇒ Object
returns an ole table body
201 202 203 |
# File 'lib/watir/table.rb', line 201 def ole_table_body_at_index(n) return @o.tBodies.item(n-1) end |