require 'csv'
module PanicBoardData
class Table
attr_accessor :data
def to_html
result = "
"
if data
data.each do |record|
result << ""
record.each do |item|
result << "#{item} | "
end
result << "
"
end
end
result << "
"
end
def self.to_csv data
::CSV.generate do |csv|
data.each { |row| csv << row }
end.strip
end
end
end