Class: SwitchUser::BaseGuard
- Inherits:
-
Object
- Object
- SwitchUser::BaseGuard
- Defined in:
- lib/switch_user/base_guard.rb
Direct Known Subclasses
Instance Method Summary collapse
- #controller_available? ⇒ Boolean
-
#initialize(controller, provider) ⇒ BaseGuard
constructor
TODO: is this the best arguments for the initializer ? TODO should @provider be set and current/original_user be added as # accessors ?.
- #view_available? ⇒ Boolean
Constructor Details
#initialize(controller, provider) ⇒ BaseGuard
TODO: is this the best arguments for the initializer ? TODO should @provider be set and current/original_user be added as # accessors ?
7 8 9 10 11 12 |
# 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 |
Instance Method Details
#controller_available? ⇒ Boolean
14 15 16 |
# File 'lib/switch_user/base_guard.rb', line 14 def controller_available? raise NotImplementedError, 'you must implement controller_available?' end |
#view_available? ⇒ Boolean
18 19 20 |
# File 'lib/switch_user/base_guard.rb', line 18 def view_available? controller_available? end |