Class: Milestoner::Commits::Enrichers::Note
- Inherits:
-
Object
- Object
- Milestoner::Commits::Enrichers::Note
- Defined in:
- lib/milestoner/commits/enrichers/note.rb
Overview
Enriches commit notes by rendering as HTML based on trailer information.
Instance Method Summary collapse
- #call(commit) ⇒ Object
-
#initialize(key: "Format", renderer: Renderers::Universal.new) ⇒ Note
constructor
A new instance of Note.
Constructor Details
#initialize(key: "Format", renderer: Renderers::Universal.new) ⇒ Note
Returns a new instance of Note.
10 11 12 13 14 |
# File 'lib/milestoner/commits/enrichers/note.rb', line 10 def initialize(key: "Format", renderer: Renderers::Universal.new, **) super(**) @key = key @renderer = renderer end |
Instance Method Details
#call(commit) ⇒ Object
16 17 18 19 20 |
# File 'lib/milestoner/commits/enrichers/note.rb', line 16 def call commit commit.trailer_value_for(key) .value_or(settings.commit_format) .then { |format| renderer.call commit.notes, for: format.to_sym } end |