Class Clio::Layout::Table
In: lib/clio/layout/table.rb
Parent: Layout

Table

Currently the table layout class is very simplistic. Ultimately it will support headers, footers, and a varity of border options.

Methods

cell   new   row   to_s  

Attributes

rows  [R] 

Public Class methods

[Source]

# File lib/clio/layout/table.rb, line 17
      def initialize(*rows_of_cells, &block)
        @rows = rows_of_cells
      end

Public Instance methods

[Source]

# File lib/clio/layout/table.rb, line 26
      def cell(acell)
        (@rows.last ||= []) << acell
      end

[Source]

# File lib/clio/layout/table.rb, line 21
      def row(*cells, &block)
        @rows << cells
        instance_eval(&block)
      end

[Source]

# File lib/clio/layout/table.rb, line 30
      def to_s
        #screen_width
        rows.collect{ |cells|
          cells.join(' ')
        }.join("\n")
      end

[Validate]