class Milestoner::Commits::Enricher
Enriches commits and associated trailers for final processing.
Attributes
Public Class Methods
Source
# File lib/milestoner/commits/enricher.rb, line 28 def initialize(categorizer: Commits::Categorizer.new, model: Models::Commit, **) super(**) @categorizer = categorizer @model = model end
Calls superclass method
Public Instance Methods
Source
# 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
Private Instance Methods
Source
# File lib/milestoner/commits/enricher.rb, line 46 def build_attributes commit infused_keys.each.with_object({}) do |key, attributes| attributes[key] = __send__(key).call commit end end
Source
# File lib/milestoner/commits/enricher.rb, line 44 def build_record(position, commit) = model.for commit, position:, **build_attributes(commit) def build_attributes commit infused_keys.each.with_object({}) do |key, attributes| attributes[key] = __send__(key).call commit end end end