Class: Auth::Behavior::RememberMe::Configuration
- Inherits:
-
Object
- Object
- Auth::Behavior::RememberMe::Configuration
- Defined in:
- lib/auth/behavior/remember_me/configuration.rb
Instance Attribute Summary collapse
-
#configuration ⇒ Object
readonly
Provides a handle back to the root configuration object.
-
#duration ⇒ Object
How long can a user stay logged in?.
-
#token_theft_message ⇒ Object
Message to be displayed in flash when a likely theft of the remember token has been detected.
Instance Method Summary collapse
-
#enabled? ⇒ Boolean
Returns true if the root configuration object’s behaviors include :remember_me.
-
#initialize(configuration) ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize(configuration) ⇒ Configuration
Returns a new instance of Configuration.
16 17 18 19 20 |
# File 'lib/auth/behavior/remember_me/configuration.rb', line 16 def initialize(configuration) @configuration = configuration @token_theft_message = "Your account may have been hijacked recently! Verify that all settings are correct." @duration = 6.months end |
Instance Attribute Details
#configuration ⇒ Object (readonly)
Provides a handle back to the root configuration object.
9 10 11 |
# File 'lib/auth/behavior/remember_me/configuration.rb', line 9 def configuration @configuration end |
#duration ⇒ Object
How long can a user stay logged in?
6 7 8 |
# File 'lib/auth/behavior/remember_me/configuration.rb', line 6 def duration @duration end |
#token_theft_message ⇒ Object
Message to be displayed in flash when a likely theft of the remember token has been detected.
3 4 5 |
# File 'lib/auth/behavior/remember_me/configuration.rb', line 3 def @token_theft_message end |
Instance Method Details
#enabled? ⇒ Boolean
Returns true if the root configuration object’s behaviors include :remember_me.
12 13 14 |
# File 'lib/auth/behavior/remember_me/configuration.rb', line 12 def enabled? configuration.behaviors.include? :remember_me end |