Class: Milestoner::Configuration::Transformers::Generator::Label

Inherits:
Object
  • Object
show all
Defined in:
lib/milestoner/configuration/transformers/generator/label.rb

Overview

Conditionally updates generator label based on gem specification.

Instance Method Summary collapse

Constructor Details

#initialize(key = :generator_label) ⇒ Label

Returns a new instance of Label.



14
15
16
17
# File 'lib/milestoner/configuration/transformers/generator/label.rb', line 14

def initialize(key = :generator_label, **)
  super(**)
  @key = key
end

Instance Method Details

#call(attributes) ⇒ Object



19
20
21
22
# File 'lib/milestoner/configuration/transformers/generator/label.rb', line 19

def call attributes
  attributes.fetch(key) { attributes.merge! key => specification.label }
  Success attributes
end