Class: Rubysmith::Configuration::Transformers::GitHubUser

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

Overview

Dynamically adds GitHub user if user is defined.

Instance Method Summary collapse

Constructor Details

#initialize(key = :git_hub_user) ⇒ GitHubUser

Returns a new instance of GitHubUser.



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

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

Instance Method Details

#call(attributes) ⇒ Object



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

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