Class: Rubysmith::Configuration::Transformers::GitEmail

Inherits:
Object
  • Object
show all
Defined in:
lib/rubysmith/configuration/transformers/git_email.rb

Overview

Dynamically adds Git email if defined.

Instance Method Summary collapse

Constructor Details

#initialize(key = :author_email) ⇒ GitEmail

Returns a new instance of GitEmail.



13
14
15
16
# File 'lib/rubysmith/configuration/transformers/git_email.rb', line 13

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

Instance Method Details

#call(attributes) ⇒ Object



18
# File 'lib/rubysmith/configuration/transformers/git_email.rb', line 18

def call(attributes) = attributes[key] ? Success(attributes) : email_or(attributes)