Class: Devise::PathChecker
- Inherits:
-
Object
- Object
- Devise::PathChecker
- Defined in:
- lib/devise_session_limit/path_checker.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(env, scope) ⇒ PathChecker
constructor
A new instance of PathChecker.
- #signing_out? ⇒ Boolean
Constructor Details
#initialize(env, scope) ⇒ PathChecker
Returns a new instance of PathChecker.
13 14 15 16 |
# File 'lib/devise_session_limit/path_checker.rb', line 13 def initialize(env, scope) @current_path = "/#{env["SCRIPT_NAME"]}/#{env["PATH_INFO"]}".squeeze("/") @scope = scope end |
Class Method Details
.default_url_options(*args) ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/devise_session_limit/path_checker.rb', line 5 def self.(*args) if defined?(ApplicationController) ApplicationController.(*args) else {} end end |
Instance Method Details
#signing_out? ⇒ Boolean
18 19 20 21 |
# File 'lib/devise_session_limit/path_checker.rb', line 18 def signing_out? route = "destroy_#{@scope}_session_path" respond_to?(route) && @current_path == send(route) end |