require 'csv' module PanicBoardData class Table attr_accessor :data, :widths, :base_image_url def build_image value url = [self.base_image_url, value] .select { |x| x.to_s != '' } .map { |x| x.to_s.strip } .map { |x| x.gsub('/', '') } .join('/') .gsub('http:', 'http://') .gsub('https:', 'https://') "" end def to_html result = "
#{value} | " else result << "#{value} | " end end result << "