class SwitchUser::BaseGuard

Public Class Methods

new(controller, provider) click to toggle source

TODO: is this the best arguments for the initializer ? TODO should @provider be set and current/original_user be added as # accessors ?

# File lib/switch_user/base_guard.rb, line 7
def initialize(controller, provider)
  @controller = controller
  @request = controller.request
  @current_user = provider.current_user
  @original_user = provider.original_user
end

Public Instance Methods

controller_available?() click to toggle source
# File lib/switch_user/base_guard.rb, line 14
def controller_available?
  raise NotImplementedError, 'you must implement controller_available?'
end
view_available?() click to toggle source
# File lib/switch_user/base_guard.rb, line 18
def view_available?
  controller_available?
end