Class: Milestoner::Commits::Enricher

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

Overview

Enriches commits and associated trailers for final processing.

Instance Method Summary collapse

Constructor Details

#initialize(categorizer: Commits::Categorizer.new, model: Models::Commit) ⇒ Enricher

Returns a new instance of Enricher.



26
27
28
29
30
# File 'lib/milestoner/commits/enricher.rb', line 26

def initialize(categorizer: Commits::Categorizer.new, model: Models::Commit, **)
  @categorizer = categorizer
  @model = model
  super(**)
end

Instance Method Details

#call(min: Collector::MIN, max: Collector::MAX) ⇒ Object



32
33
34
35
36
# File 'lib/milestoner/commits/enricher.rb', line 32

def call min: Collector::MIN, max: Collector::MAX
  categorizer.call(min:, max:)
             .map { |commit| model.for(commit, **build_attributes(commit)) }
             .then { |commits| Success commits }
end