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 ?
5 6 7 8 9 10 |
# File 'lib/switch_user/base_guard.rb', line 5 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
12 13 14 |
# File 'lib/switch_user/base_guard.rb', line 12 def controller_available? raise NotImplementedError.new("you must implement controller_available?") end |
#view_available? ⇒ Boolean
16 17 18 |
# File 'lib/switch_user/base_guard.rb', line 16 def view_available? controller_available? end |