class Milestoner::Commits::Enricher

Enriches commits and associated trailers for final processing.

Attributes

categorizer[R]
model[R]

Public Class Methods

new(categorizer: Commits::Categorizer.new, model: Models::Commit, **) click to toggle source
Calls superclass method
# File lib/milestoner/commits/enricher.rb, line 26
def initialize(categorizer: Commits::Categorizer.new, model: Models::Commit, **)
  @categorizer = categorizer
  @model = model
  super(**)
end

Public Instance Methods

call(min: Collector::MIN, max: Collector::MAX) click to toggle source
# 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

Private Instance Methods

build_attributes(commit) click to toggle source
# File lib/milestoner/commits/enricher.rb, line 42
def build_attributes commit
  infused_keys.each.with_object({}) do |key, attributes|
    attributes[key] = __send__(key).call commit
  end
end