Sha256: 2b339d12a9e657a34fef4f67cc93d37c3299858fb1db9c842f7f5a7d5cf3d841

Contents?: true

Size: 603 Bytes

Versions: 1

Compression:

Stored size: 603 Bytes

Contents

module Celerity
  class TableBody < Element
    include Enumerable # specs for this? 
    
    TAGS = [ Identifier.new('tbody') ]
    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-1])
    end

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

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
celerity-0.0.4 lib/celerity/elements/table_body.rb