Sha256: 6c1c09e3a23b52bbbdf48bb6bd8c41ff9b866ddfab9e1bf13538e1fcd57e91e3

Contents?: true

Size: 644 Bytes

Versions: 38

Compression:

Stored size: 644 Bytes

Contents

module Watir
  module RowContainer

    #
    # Returns table row.
    #

    def row(*args)
      Row.new(self, extract_selector(args).merge(tag_name: "tr"))
    end

    #
    # Returns table rows collection.
    #

    def rows(*args)
      RowCollection.new(self, extract_selector(args).merge(tag_name: "tr"))
    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_method :to_a, :strings

  end # RowContainer
end # Watir

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
watir-6.13.0 lib/watir/row_container.rb
watir-6.12.0 lib/watir/row_container.rb
watir-6.11.0 lib/watir/row_container.rb
watir-6.11.0.beta2 lib/watir/row_container.rb
watir-6.11.0.beta1 lib/watir/row_container.rb
watir-6.10.3 lib/watir/row_container.rb
watir-6.10.2 lib/watir/row_container.rb
watir-6.10.0 lib/watir/row_container.rb
watir-6.9.1 lib/watir/row_container.rb
watir-6.9.0 lib/watir/row_container.rb
watir-6.8.4 lib/watir/row_container.rb
watir-6.8.3 lib/watir/row_container.rb
watir-6.8.2 lib/watir/row_container.rb
watir-6.8.1 lib/watir/row_container.rb
watir-6.8.0 lib/watir/row_container.rb
watir-6.7.3 lib/watir/row_container.rb
watir-6.7.2 lib/watir/row_container.rb
watir-6.7.1 lib/watir/row_container.rb
watir-6.7.0 lib/watir/row_container.rb
watir-6.6.3 lib/watir/row_container.rb