Class: Veri::Configuration
- Inherits:
-
Object
- Object
- Veri::Configuration
- Includes:
- Singleton
- Defined in:
- lib/veri/configuration.rb
Constant Summary collapse
- HASHERS =
{ argon2: Veri::Password::Argon2, bcrypt: Veri::Password::BCrypt, pbkdf2: Veri::Password::Pbkdf2, scrypt: Veri::Password::SCrypt }.freeze
Instance Attribute Summary collapse
-
#hashing_algorithm ⇒ Object
Returns the value of attribute hashing_algorithm.
-
#inactive_session_lifetime ⇒ Object
Returns the value of attribute inactive_session_lifetime.
-
#total_session_lifetime ⇒ Object
Returns the value of attribute total_session_lifetime.
-
#user_model_name ⇒ Object
Returns the value of attribute user_model_name.
Instance Method Summary collapse
- #configure {|_self| ... } ⇒ Object
- #hasher ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #reset_to_defaults! ⇒ Object
- #user_model ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
10 11 12 |
# File 'lib/veri/configuration.rb', line 10 def initialize reset_to_defaults! end |
Instance Attribute Details
#hashing_algorithm ⇒ Object
Returns the value of attribute hashing_algorithm.
8 9 10 |
# File 'lib/veri/configuration.rb', line 8 def hashing_algorithm @hashing_algorithm end |
#inactive_session_lifetime ⇒ Object
Returns the value of attribute inactive_session_lifetime.
8 9 10 |
# File 'lib/veri/configuration.rb', line 8 def inactive_session_lifetime @inactive_session_lifetime end |
#total_session_lifetime ⇒ Object
Returns the value of attribute total_session_lifetime.
8 9 10 |
# File 'lib/veri/configuration.rb', line 8 def total_session_lifetime @total_session_lifetime end |
#user_model_name ⇒ Object
Returns the value of attribute user_model_name.
8 9 10 |
# File 'lib/veri/configuration.rb', line 8 def user_model_name @user_model_name end |
Instance Method Details
#configure {|_self| ... } ⇒ Object
73 74 75 |
# File 'lib/veri/configuration.rb', line 73 def configure yield self end |
#hasher ⇒ Object
61 62 63 |
# File 'lib/veri/configuration.rb', line 61 def hasher HASHERS.fetch(hashing_algorithm) end |
#reset_to_defaults! ⇒ Object
54 55 56 57 58 59 |
# File 'lib/veri/configuration.rb', line 54 def reset_to_defaults! self.hashing_algorithm = :argon2 self.inactive_session_lifetime = nil self.total_session_lifetime = 14.days self.user_model_name = "User" end |