Class: Watir::TableElementCollection

Inherits:
ElementCollection show all
Defined in:
lib/watir-classic/element_collection.rb

Direct Known Subclasses

TableCellCollection, TableRowCollection

Instance Method Summary collapse

Methods inherited from ElementCollection

#[], #first, #inspect, #last, #length, #to_s

Constructor Details

#initialize(container, specifiers, ole_collection = nil) ⇒ TableElementCollection

Returns a new instance of TableElementCollection.



75
76
77
78
# File 'lib/watir-classic/element_collection.rb', line 75

def initialize(container, specifiers, ole_collection=nil)
  super container, specifiers
  @ole_collection = ole_collection
end

Instance Method Details

#eachObject



80
81
82
83
84
85
86
87
88
89
90
# File 'lib/watir-classic/element_collection.rb', line 80

def each
  if @ole_collection
    elements = []
    @ole_collection.each {|element| elements << element_class.new(@container, :ole_object => element)}
    super do |element|
      yield element if elements.include?(element)
    end
  else
    super
  end
end