Permalink
Browse files

make Table#strings method to not iterate over inner tables

  • Loading branch information...
jarmo committed Jan 6, 2012
1 parent dfbef49 commit 983b4a6d3eb3127f07ed7ba5257496a99cb5cb94
Showing with 8 additions and 4 deletions.
  1. +8 −4 watir/lib/watir/table.rb
View
@@ -5,16 +5,20 @@ module RowContainer
# * index - the index of the row
def [](index)
assert_exists
- TableRow.new(@container, :ole_object, @o.rows.item(index))
+ TableRow.new(self, :ole_object, @o.rows.item(index))
end
def strings
assert_exists
- rows.reduce([]) do |rows_memo, row|
- rows_memo << row.cells.reduce([]) do |cells_memo, cell|
- cells_memo << cell.text
+ rows_memo = []
+ @o.rows.each do |row|
+ cells_memo = []
+ row.cells.each do |cell|
+ cells_memo << TableCell.new(self, :ole_object, cell).text
end
+ rows_memo << cells_memo
end
+ rows_memo
end
def hashes

0 comments on commit 983b4a6

Please sign in to comment.