Sha256: 0f0ca1bc701a80291c1b18010adc57a1ed44d6080b483af3f4ba0c3434d30e49
Contents?: true
Size: 764 Bytes
Versions: 16
Compression:
Stored size: 764 Bytes
Contents
module ActiveRecordCSVImporter # Generate a human readable message for the given report. class ReportMessage def self.call(report) new(report).to_s end def initialize(report) @report = report end attr_accessor :report def to_s send("report_#{report.status}") end private def report_pending "Import hasn't started yet" end def report_in_progress 'Import in progress' end def report_done 'Import completed' end def report_invalid_header "The following columns are required: #{report.missing_columns.join(', ')}" end def report_invalid_csv_file report.parser_error end def report_aborted 'Import aborted' end end end
Version data entries
16 entries across 16 versions & 1 rubygems