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 << "" end result << "" end end result << "
#{item}
" end def self.to_csv data ::CSV.generate do |csv| data.each { |row| csv << row } end.strip end end end