class SwitchUser::LambdaGuard
Public Instance Methods
controller_available?()
click to toggle source
# File lib/switch_user/lambda_guard.rb, line 5 def controller_available? call(SwitchUser.controller_guard) end
view_available?()
click to toggle source
# File lib/switch_user/lambda_guard.rb, line 9 def view_available? call(SwitchUser.view_guard) end
Private Instance Methods
args()
click to toggle source
# File lib/switch_user/lambda_guard.rb, line 15 def args [@current_user, @request, @original_user, @controller] end
call(guard)
click to toggle source
# File lib/switch_user/lambda_guard.rb, line 19 def call(guard) arity = guard.arity guard.call(*args[0...arity]) end