Class: Milestoner::Commits::Enrichers::Format

Inherits:
Object
  • Object
show all
Defined in:
lib/milestoner/commits/enrichers/format.rb

Overview

Enriches a commit format based on trailer information.

Instance Method Summary collapse

Constructor Details

#initialize(key: "Format") ⇒ Format

Returns a new instance of Format.



10
11
12
13
# File 'lib/milestoner/commits/enrichers/format.rb', line 10

def initialize(key: "Format", **)
  super(**)
  @key = key
end

Instance Method Details

#call(commit) ⇒ Object



15
# File 'lib/milestoner/commits/enrichers/format.rb', line 15

def call(commit) = commit.trailer_value_for(key).value_or(settings.commit_format)