Parent

Methods

Clio::Layout::Table

Table

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

Attributes

rows[R]

Public Class Methods

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

Public Instance Methods

cell(acell) click to toggle source
# File lib/clio/layout/table.rb, line 26
def cell(acell)
  (@rows.last ||= []) << acell
end
row(*cells, &block) click to toggle source
# File lib/clio/layout/table.rb, line 21
def row(*cells, &block)
  @rows << cells
  instance_eval(&block)
end
to_s() click to toggle source
# File lib/clio/layout/table.rb, line 30
def to_s
  #screen_width
  rows.collect{ |cells|
    cells.join(' ')
  }.join("\n")
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.