Sha256: d17e21193cad561c1078ce1c83dc4b6ddf572246da4e08c52068d06cb0f34b17

Contents?: true

Size: 560 Bytes

Versions: 45

Compression:

Stored size: 560 Bytes

Contents

module Watir
  module RowContainer

    def row(*args)
      row = tr(*args)
      row.locator_class = ChildRowLocator

      row
    end

    def rows(*args)
      rows = trs(*args)
      rows.locator_class = ChildRowLocator

      rows
    end
    
    #
    # The table as a 2D Array of strings with the text of each cell.
    #
    # @return [Array<Array<String>>]
    #

    def strings
      assert_exists

      rows.inject [] do |res, row|
        res << row.cells.map { |cell| cell.text }
      end
    end
    alias_method :to_a, :strings

  end
end

Version data entries

45 entries across 45 versions & 2 rubygems

Version Path
watir-webdriver-0.6.1 lib/watir-webdriver/row_container.rb
watir-webdriver-0.6.0 lib/watir-webdriver/row_container.rb
watir-webdriver-0.5.8 lib/watir-webdriver/row_container.rb
watir-webdriver-0.5.7 lib/watir-webdriver/row_container.rb
watir-webdriver-0.5.6 lib/watir-webdriver/row_container.rb
watir-webdriver-0.5.5 lib/watir-webdriver/row_container.rb
watir-webdriver-0.5.4 lib/watir-webdriver/row_container.rb
watir-webdriver-0.5.3 lib/watir-webdriver/row_container.rb
watir-webdriver-0.5.2 lib/watir-webdriver/row_container.rb
watir-webdriver-0.5.1 lib/watir-webdriver/row_container.rb
watir-webdriver-0.5.0 lib/watir-webdriver/row_container.rb
watir-webdriver-0.4.1 lib/watir-webdriver/row_container.rb
watir-webdriver-0.4.0 lib/watir-webdriver/row_container.rb
watir-webdriver-0.3.9 lib/watir-webdriver/row_container.rb
watir-webdriver-0.3.8 lib/watir-webdriver/row_container.rb
watir-webdriver-0.3.7 lib/watir-webdriver/row_container.rb
watir-webdriver-0.3.6 lib/watir-webdriver/row_container.rb
watir-webdriver-0.3.5 lib/watir-webdriver/row_container.rb
watir-webdriver-0.3.4 lib/watir-webdriver/row_container.rb
watir-webdriver-0.3.3 lib/watir-webdriver/row_container.rb