Class: Sorcery::Model::Config
- Inherits:
-
Object
- Object
- Sorcery::Model::Config
- Defined in:
- lib/sorcery/model/config.rb
Instance Attribute Summary collapse
-
#after_config ⇒ Object
change default username attribute, for example, to use :email.
-
#before_authenticate ⇒ Object
change default username attribute, for example, to use :email.
-
#crypted_password_attribute_name ⇒ Object
change default username attribute, for example, to use :email.
-
#custom_encryption_provider ⇒ Object
an array of method names to call after configuration by user.
-
#downcase_username_before_authenticating ⇒ Object
change default username attribute, for example, to use :email.
-
#email_attribute_name ⇒ Object
change default username attribute, for example, to use :email.
-
#encryption_algorithm ⇒ Object
an array of method names to call after configuration by user.
-
#encryption_key ⇒ Object
change default username attribute, for example, to use :email.
-
#encryption_provider ⇒ Object
readonly
an array of method names to call after configuration by user.
-
#password_attribute_name ⇒ Object
change default username attribute, for example, to use :email.
-
#salt_attribute_name ⇒ Object
change default username attribute, for example, to use :email.
-
#salt_join_token ⇒ Object
change default username attribute, for example, to use :email.
-
#stretches ⇒ Object
change default username attribute, for example, to use :email.
-
#subclasses_inherit_config ⇒ Object
change default username attribute, for example, to use :email.
-
#submodules ⇒ Object
change default username attribute, for example, to use :email.
-
#username_attribute_names ⇒ Object
change default username attribute, for example, to use :email.
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
encryption algorithm name.
-
#reset! ⇒ Object
Resets all configuration options to their default values.
Constructor Details
#initialize ⇒ Config
encryption algorithm name. See ‘encryption_algorithm=’ below for available options.
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/sorcery/model/config.rb', line 40 def initialize @defaults = { :@submodules => [], :@username_attribute_names => [:email], :@password_attribute_name => :password, :@downcase_username_before_authenticating => false, :@email_attribute_name => :email, :@crypted_password_attribute_name => :crypted_password, :@encryption_algorithm => :bcrypt, :@encryption_provider => CryptoProviders::BCrypt, :@custom_encryption_provider => nil, :@encryption_key => nil, :@salt_join_token => "", :@salt_attribute_name => :salt, :@stretches => nil, :@subclasses_inherit_config => false, :@before_authenticate => [], :@after_config => [] } reset! end |
Instance Attribute Details
#after_config ⇒ Object
change default username attribute, for example, to use :email
8 9 10 |
# File 'lib/sorcery/model/config.rb', line 8 def after_config @after_config end |
#before_authenticate ⇒ Object
change default username attribute, for example, to use :email
8 9 10 |
# File 'lib/sorcery/model/config.rb', line 8 def before_authenticate @before_authenticate end |
#crypted_password_attribute_name ⇒ Object
change default username attribute, for example, to use :email
8 9 10 |
# File 'lib/sorcery/model/config.rb', line 8 def crypted_password_attribute_name @crypted_password_attribute_name end |
#custom_encryption_provider ⇒ Object
an array of method names to call after configuration by user. used internally.
35 36 37 |
# File 'lib/sorcery/model/config.rb', line 35 def custom_encryption_provider @custom_encryption_provider end |
#downcase_username_before_authenticating ⇒ Object
change default username attribute, for example, to use :email
8 9 10 |
# File 'lib/sorcery/model/config.rb', line 8 def downcase_username_before_authenticating @downcase_username_before_authenticating end |
#email_attribute_name ⇒ Object
change default username attribute, for example, to use :email
8 9 10 |
# File 'lib/sorcery/model/config.rb', line 8 def email_attribute_name @email_attribute_name end |
#encryption_algorithm ⇒ Object
an array of method names to call after configuration by user. used internally.
35 36 37 |
# File 'lib/sorcery/model/config.rb', line 35 def encryption_algorithm @encryption_algorithm end |
#encryption_key ⇒ Object
change default username attribute, for example, to use :email
8 9 10 |
# File 'lib/sorcery/model/config.rb', line 8 def encryption_key @encryption_key end |
#encryption_provider ⇒ Object (readonly)
an array of method names to call after configuration by user. used internally.
35 36 37 |
# File 'lib/sorcery/model/config.rb', line 35 def encryption_provider @encryption_provider end |
#password_attribute_name ⇒ Object
change default username attribute, for example, to use :email
8 9 10 |
# File 'lib/sorcery/model/config.rb', line 8 def password_attribute_name @password_attribute_name end |
#salt_attribute_name ⇒ Object
change default username attribute, for example, to use :email
8 9 10 |
# File 'lib/sorcery/model/config.rb', line 8 def salt_attribute_name @salt_attribute_name end |
#salt_join_token ⇒ Object
change default username attribute, for example, to use :email
8 9 10 |
# File 'lib/sorcery/model/config.rb', line 8 def salt_join_token @salt_join_token end |
#stretches ⇒ Object
change default username attribute, for example, to use :email
8 9 10 |
# File 'lib/sorcery/model/config.rb', line 8 def stretches @stretches end |
#subclasses_inherit_config ⇒ Object
change default username attribute, for example, to use :email
8 9 10 |
# File 'lib/sorcery/model/config.rb', line 8 def subclasses_inherit_config @subclasses_inherit_config end |
#submodules ⇒ Object
change default username attribute, for example, to use :email
8 9 10 |
# File 'lib/sorcery/model/config.rb', line 8 def submodules @submodules end |
#username_attribute_names ⇒ Object
change default username attribute, for example, to use :email
8 9 10 |
# File 'lib/sorcery/model/config.rb', line 8 def username_attribute_names @username_attribute_names end |
Instance Method Details
#reset! ⇒ Object
Resets all configuration options to their default values.
63 64 65 66 67 |
# File 'lib/sorcery/model/config.rb', line 63 def reset! @defaults.each do |k,v| instance_variable_set(k,v) end end |