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.



28
29
30
31
32
# File 'lib/milestoner/commits/enricher.rb', line 28

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

Instance Method Details

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



34
35
36
37
38
# File 'lib/milestoner/commits/enricher.rb', line 34

def call min: Collector::MIN, max: Collector::MAX
  categorizer.call(min:, max:)
             .map { |(position, commit)| build_record position, commit }
             .then { |commits| Success commits }
end