Class: ActiveRecordCSVImporter::ReportMessage
- Inherits:
-
Object
- Object
- ActiveRecordCSVImporter::ReportMessage
- Defined in:
- lib/activerecord_csv_importer/report_message.rb
Overview
Generate a human readable message for the given report.
Instance Attribute Summary collapse
-
#report ⇒ Object
Returns the value of attribute report.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(report) ⇒ ReportMessage
constructor
A new instance of ReportMessage.
- #to_s ⇒ Object
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
#report ⇒ Object
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_s ⇒ Object
14 15 16 |
# File 'lib/activerecord_csv_importer/report_message.rb', line 14 def to_s send("report_#{report.status}") end |