Class: Foobara::Auth::FindUser

Inherits:
Command
  • Object
show all
Defined in:
foobara-auth-0.1.1/src/find_user.rb

Defined Under Namespace

Classes: UserNotFoundError

Constant Summary

Constants included from TruncatedInspect

TruncatedInspect::MAX_LENGTH

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Command

install!

Methods included from TruncatedInspect

#inspect, truncating

Methods included from Concern

foobara_class_methods_module_for, foobara_concern?, included

Instance Attribute Details

#userObject

Returns the value of attribute user.



30
31
32
# File 'src/find_user.rb', line 30

def user
  @user
end

Instance Method Details

#executeObject



24
25
26
27
28
# File 'src/find_user.rb', line 24

def execute
  load_user

  user
end

#load_userObject



32
33
34
35
36
37
38
# File 'src/find_user.rb', line 32

def load_user
  self.user = Types::User.find_by(inputs)

  unless user
    add_runtime_error(UserNotFoundError.new(context: inputs))
  end
end