Sha256: 1b9617a54697f3d70084c61bee1048364b6ef576f92c5e92a00f825515e188f7

Contents?: true

Size: 832 Bytes

Versions: 59

Compression:

Stored size: 832 Bytes

Contents

module Celerity
  class TableElement < Element
    include Enumerable
    include ClickableElement

    ATTRIBUTES = BASE_ATTRIBUTES | CELLHALIGN_ATTRIBUTES | CELLVALIGN_ATTRIBUTES
    DEFAULT_HOW = :id

    def locate
      super
      @rows = @object.getRows if @object
    end

    def [](index)
      assert_exists
      TableRow.new(self, :object, @rows[index - Celerity.index_offset])
    end

    def length
      assert_exists
      @object.getRows.length
    end

    def each
      assert_exists
      @rows.each { |row| yield TableRow.new(self, :object, row) }
    end
  end

  class TableBody < TableElement
    TAGS = [ Identifier.new('tbody') ]
  end

  class TableFooter < TableElement
    TAGS = [ Identifier.new('tfoot') ]
  end

  class TableHeader < TableElement
    TAGS = [ Identifier.new('thead') ]
  end

end

Version data entries

59 entries across 59 versions & 11 rubygems

Version Path
caius-celerity-0.0.6.10 lib/celerity/elements/table_elements.rb
caius-celerity-0.0.6.11 lib/celerity/elements/table_elements.rb
drnic-celerity-0.0.6.17 lib/celerity/elements/table_elements.rb
jarib-celerity-0.0.6.10 lib/celerity/elements/table_elements.rb
jarib-celerity-0.0.6.11 lib/celerity/elements/table_elements.rb
jarib-celerity-0.0.6.12 lib/celerity/elements/table_elements.rb
jarib-celerity-0.0.6.14 lib/celerity/elements/table_elements.rb
jarib-celerity-0.0.6.15 lib/celerity/elements/table_elements.rb
jarib-celerity-0.0.6.16 lib/celerity/elements/table_elements.rb
jarib-celerity-0.0.6.17 lib/celerity/elements/table_elements.rb
jarib-celerity-0.0.6.18 lib/celerity/elements/table_elements.rb
jarib-celerity-0.0.6.19 lib/celerity/elements/table_elements.rb
jarib-celerity-0.0.7.1 lib/celerity/elements/table_elements.rb
regularfry-celerity-0.0.6.12 lib/celerity/elements/table_elements.rb
walidhalabi-celerity-0.0.6.11 lib/celerity/elements/table_elements.rb
walidhalabi-celerity-0.0.6.12 lib/celerity/elements/table_elements.rb
walidhalabi-celerity-0.0.6.13 lib/celerity/elements/table_elements.rb
celerity_thingista-0.9.3 lib/celerity/elements/table_elements.rb
celerity_thingista-0.9.2 lib/celerity/elements/table_elements.rb
frameworks-capybara-0.2.0.rc6 vendor/bundle/ruby/1.8/gems/celerity-0.9.2/lib/celerity/elements/table_elements.rb