class Timesheets::CSVTable

Public Class Methods

new(options, &block) click to toggle source
# File lib/timesheets/csv_table.rb, line 3
def initialize(options, &block)
  @heading = options[:headings]
  @rows = []
  block.call(self)
end

Public Instance Methods

<<(row) click to toggle source
# File lib/timesheets/csv_table.rb, line 9
def <<(row)
  @rows << row unless row == :separator
end
align_column(n, alignment) click to toggle source
# File lib/timesheets/csv_table.rb, line 13
def align_column(n, alignment)
end
to_s() click to toggle source
# File lib/timesheets/csv_table.rb, line 16
def to_s
  ([@heading] + @rows).map {|row| row.map {|cell| "\"#{cell}\"" }.join(",") }.join("\n")
end