Sha256: 5cbf88e786c85f214624b2290b7b6e63f4d310ab85221281ec080910f3db6235

Contents?: true

Size: 521 Bytes

Versions: 16

Compression:

Stored size: 521 Bytes

Contents

# frozen_string_literal: true

module Milestoner
  module Commits
    module Enrichers
      # Enriches a commit author by using cache.
      class Author
        include Milestoner::Import[:cache]

        def initialize(model: Models::User, **)
          @model = model
          super(**)
        end

        def call commit
          cache.read(:users) { |table| table.find commit.author_name }
               .value_or(model.new)
        end

        private

        attr_reader :model
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
milestoner-18.11.0 lib/milestoner/commits/enrichers/author.rb
milestoner-18.10.0 lib/milestoner/commits/enrichers/author.rb
milestoner-18.9.0 lib/milestoner/commits/enrichers/author.rb
milestoner-18.8.0 lib/milestoner/commits/enrichers/author.rb
milestoner-18.7.0 lib/milestoner/commits/enrichers/author.rb
milestoner-18.6.0 lib/milestoner/commits/enrichers/author.rb
milestoner-18.5.0 lib/milestoner/commits/enrichers/author.rb
milestoner-18.4.0 lib/milestoner/commits/enrichers/author.rb
milestoner-18.3.0 lib/milestoner/commits/enrichers/author.rb
milestoner-18.2.0 lib/milestoner/commits/enrichers/author.rb
milestoner-18.1.0 lib/milestoner/commits/enrichers/author.rb
milestoner-18.0.1 lib/milestoner/commits/enrichers/author.rb
milestoner-18.0.0 lib/milestoner/commits/enrichers/author.rb
milestoner-17.11.0 lib/milestoner/commits/enrichers/author.rb
milestoner-17.10.0 lib/milestoner/commits/enrichers/author.rb
milestoner-17.9.0 lib/milestoner/commits/enrichers/author.rb