Class: ActiveRecordCSVImporter::ReportMessage

Inherits:
Object
  • Object
show all
Defined in:
lib/activerecord_csv_importer/report_message.rb

Overview

Generate a human readable message for the given report.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(report) ⇒ ReportMessage

Returns a new instance of ReportMessage.



8
9
10
# File 'lib/activerecord_csv_importer/report_message.rb', line 8

def initialize(report)
  @report = report
end

Instance Attribute Details

#reportObject

Returns the value of attribute report.



12
13
14
# File 'lib/activerecord_csv_importer/report_message.rb', line 12

def report
  @report
end

Class Method Details

.call(report) ⇒ Object



4
5
6
# File 'lib/activerecord_csv_importer/report_message.rb', line 4

def self.call(report)
  new(report).to_s
end

Instance Method Details

#to_sObject



14
15
16
# File 'lib/activerecord_csv_importer/report_message.rb', line 14

def to_s
  send("report_#{report.status}")
end