Sha256: 6f4d8ee072b66c827cdca3f712cf1437c0199c534cf6c4cfda7b63674aa3513a

Contents?: true

Size: 569 Bytes

Versions: 1

Compression:

Stored size: 569 Bytes

Contents

module Druid
  module Elements
    class Table < Element

      #
      # Return the Druid::Elements::Table for the index provided.  Index
      # is zero based.
      #
      # @return [Druid::Elements::Table]
      #
      def [](idx)
        table_row = element[idx]
        Druid::Elements::TableRow.new(table_row)
      end
      #
      # Returns the number of rows in the table.
      #
      def rows
        element.rows.size
      end

      def each
        for index in 1..self.rows do
          yield self[index-1]
        end
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
druid-ts-0.0.1 lib/druid/elements/table.rb