class Milestoner::Commits::Enrichers::Author

Enriches a commit author by using cache.

Attributes

model[R]

Public Class Methods

new(model: Models::User, **) click to toggle source
Calls superclass method
# File lib/milestoner/commits/enrichers/author.rb, line 10
def initialize(model: Models::User, **)
  @model = model
  super(**)
end

Public Instance Methods

call(commit) click to toggle source
# File lib/milestoner/commits/enrichers/author.rb, line 15
def call commit
  cache.read(:users) { |table| table.find commit.author_name }
       .value_or(model.new)
end