module MakeExportable #:nodoc: class Excel < ExportableFormat #:nodoc: self.reference = :xls self.name = 'Excel' self.register_format attr_accessor :data_set, :data_headers def initialize(data_set, data_headers=[]) self.long = 'Microsoft Excel' self.mime_type = 'application/vnd.ms-excel; charset=utf-8;' self.data_set = data_set self.data_headers = data_headers end def generate generate_header_option(data_headers) output = "
#{sanitize(h.humanize.titleize)} | \n" }.join output << "\t
---|
#{sanitize(field)} | \n"}.join output << "\t