Sha256: fa33472b1ac8c42368689426cb96fbbe3e66749c4e4010605f653d6335c65298

Contents?: true

Size: 586 Bytes

Versions: 4

Compression:

Stored size: 586 Bytes

Contents

# frozen_string_literal: true

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

4 entries across 4 versions & 1 rubygems

Version Path
watir-7.3.0 lib/watir/row_container.rb
watir-7.2.2 lib/watir/row_container.rb
watir-7.2.1 lib/watir/row_container.rb
watir-7.2.0 lib/watir/row_container.rb