class Milestoner::Commits::Enrichers::Note

Enriches commit notes by rendering as HTML based on trailer information.

Attributes

key[R]
renderer[R]

Public Class Methods

new(key: "Format", renderer: Renderers::Universal.new, **) click to toggle source
Calls superclass method
# File lib/milestoner/commits/enrichers/note.rb, line 10
def initialize(key: "Format", renderer: Renderers::Universal.new, **)
  @key = key
  @renderer = renderer
  super(**)
end

Public Instance Methods

call(commit) click to toggle source
# 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