Sha256: 4f33c90e1019f4419260ad87ea40b0acd76bdd3cbb3faac7574ab29212084d82

Contents?: true

Size: 642 Bytes

Versions: 8

Compression:

Stored size: 642 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
      assert_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

8 entries across 8 versions & 2 rubygems

Version Path
watir-webdriver-0.9.9 lib/watir-webdriver/row_container.rb
watir-6.0.0.beta5 lib/watir/row_container.rb
watir-6.0.0.beta4 lib/watir/row_container.rb
watir-6.0.0.beta3 lib/watir/row_container.rb
watir-6.0.0.beta2 lib/watir/row_container.rb
watir-6.0.0.beta1 lib/watir/row_container.rb
watir-webdriver-0.9.3 lib/watir-webdriver/row_container.rb
watir-webdriver-0.9.2 lib/watir-webdriver/row_container.rb