Sha256: f30e9daefc2fb2fed49059a106394ca310e3eeedaa14a3d2b8babb515953bcf9

Contents?: true

Size: 555 Bytes

Versions: 7

Compression:

Stored size: 555 Bytes

Contents

module Watir
  module RowContainer
    #
    # Returns table row.
    #

    def row(opts)
      Row.new(self, opts)
    end

    #
    # Returns table rows collection.
    #

    def rows(opts = {})
      RowCollection.new(self, opts)
    end

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

    def strings
      wait_for_exists

      rows.inject [] do |res, row|
        res << row.cells.map(&:text)
      end
    end
    alias to_a strings
  end # RowContainer
end # Watir

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
watir-7.1.0 lib/watir/row_container.rb
watir-7.0.0 lib/watir/row_container.rb
watir-7.0.0.beta5 lib/watir/row_container.rb
watir-7.0.0.beta4 lib/watir/row_container.rb
watir-7.0.0.beta3 lib/watir/row_container.rb
watir-7.0.0.beta2 lib/watir/row_container.rb
watir-7.0.0.beta1 lib/watir/row_container.rb