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.3.2 lib/watir-webdriver/row_container.rb
watir-webdriver-0.3.1 lib/watir-webdriver/row_container.rb
watir-webdriver-0.3.0 lib/watir-webdriver/row_container.rb
watir-webdriver-0.2.9 lib/watir-webdriver/row_container.rb
watir-webdriver-0.2.8 lib/watir-webdriver/row_container.rb
watir-webdriver-0.2.7 lib/watir-webdriver/row_container.rb
watir-webdriver-0.2.6 lib/watir-webdriver/row_container.rb
watir-webdriver-0.2.5 lib/watir-webdriver/row_container.rb
watir-webdriver-0.2.4 lib/watir-webdriver/row_container.rb
watir-webdriver-0.2.3 lib/watir-webdriver/row_container.rb
watir-webdriver-0.2.2 lib/watir-webdriver/row_container.rb
watir-webdriver-0.2.1 lib/watir-webdriver/row_container.rb
watir-webdriver-0.2.0 lib/watir-webdriver/row_container.rb
watir-webdriver-0.2.0.dev2 lib/watir-webdriver/row_container.rb
watir-webdriver-0.2.0.dev lib/watir-webdriver/row_container.rb
watir-webdriver-0.1.9 lib/watir-webdriver/row_container.rb
watir-webdriver-0.1.8 lib/watir-webdriver/row_container.rb
watir-webdriver-0.1.7 lib/watir-webdriver/row_container.rb
watir-webdriver-0.1.6 lib/watir-webdriver/row_container.rb
watir-webdriver-0.1.5 lib/watir-webdriver/row_container.rb