Class: Changelog::Notifier::Formatters::ActiveRecord
- Inherits:
-
Object
- Object
- Changelog::Notifier::Formatters::ActiveRecord
- Defined in:
- lib/changelog/notifier/formatters/active_record.rb
Overview
Format the given release note hash for ActiveRecord as a multiline text
Instance Method Summary collapse
- #format ⇒ Object
-
#initialize(release_note_hash) ⇒ ActiveRecord
constructor
A new instance of ActiveRecord.
Constructor Details
#initialize(release_note_hash) ⇒ ActiveRecord
13 14 15 |
# File 'lib/changelog/notifier/formatters/active_record.rb', line 13 def initialize(release_note_hash) @release_note_hash = release_note_hash end |
Instance Method Details
#format ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/changelog/notifier/formatters/active_record.rb', line 17 def format release_note = description_text + "\n\n" Array(@release_note_hash[:changes]).each do |change, logs| release_note << "#{change.capitalize}\n#{logs.join("\n")}\n\n" end # TODO : Avoids adding newlines for the last change ... release_note.gsub(/\n\z/, '') end |