Sha256: b038e6f81937c847c13ec2e08e9c1d2a5f567f0e93b5a535583ac2f0ef417c74

Contents?: true

Size: 526 Bytes

Versions: 1

Compression:

Stored size: 526 Bytes

Contents

# frozen_string_literal: true

module Milestoner
  module Commits
    module Enrichers
      # Enriches a commit milestone based on trailer information.
      class Milestone
        include Milestoner::Import[:settings]

        def initialize(key: "Milestone", default: "unknown", **)
          super(**)
          @key = key
          @default = default
        end

        def call(commit) = commit.trailer_value_for(key).value_or(default)

        private

        attr_reader :key, :default
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
milestoner-18.12.0 lib/milestoner/commits/enrichers/milestone.rb