Sha256: 6032cc3f2352d36f5f289199b1bc0ac23013da6c6e660524a29d23001ffde7f0
Contents?: true
Size: 700 Bytes
Versions: 3
Compression:
Stored size: 700 Bytes
Contents
# frozen_string_literal: true require "dry/monads" module Milestoner module Configuration module Transformers module Generator # Conditionally updates generator label based on gem specification. class Label include Import[:specification] include Dry::Monads[:result] def initialize(key = :generator_label, **) @key = key super(**) end def call attributes attributes.fetch(key) { specification.label } .then { |value| Success attributes.merge!(key => value) } end private attr_reader :key end end end end end
Version data entries
3 entries across 3 versions & 1 rubygems