123456789_123456789_123456789_123456789_123456789_

Module: ActiveModel::SecurePassword

Relationships & Source Files
Namespace Children
Modules:
Classes:
Extension / Inclusion / Inheritance Descendants
Included In:
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Defined in: activemodel/lib/active_model/secure_password.rb,
activemodel/lib/active_model/secure_password/argon2_password.rb,
activemodel/lib/active_model/secure_password/bcrypt_password.rb

Constant Summary

Class Attribute Summary

Class Method Summary

::ActiveSupport::Concern - Extended

class_methods

Define class methods from given block.

included

Evaluate given block in context of base class, so that you can write class macros here.

prepended

Evaluate given block in context of base class, so that you can write class macros here.

append_features, prepend_features

Class Attribute Details

.min_cost (rw)

This method is for internal use only.
[ GitHub ]

  
# File 'activemodel/lib/active_model/secure_password.rb', line 15

attr_accessor :min_cost # :nodoc:

Class Method Details

.algorithm_registry

Returns the registry of password algorithms

[ GitHub ]

  
# File 'activemodel/lib/active_model/secure_password.rb', line 18

def algorithm_registry
  @algorithm_registry ||= {}
end

.lookup_algorithm(name)

Looks up a registered algorithm by name

[ GitHub ]

  
# File 'activemodel/lib/active_model/secure_password.rb', line 34

def lookup_algorithm(name)
  algorithm_registry[name.to_sym]
end

.register_algorithm(name, algorithm_class)

Registers a password algorithm for use with has_secure_password

<code>register_algorithm</code> :argon2, Argon2Password

The algorithm class will be instantiated when used.

[ GitHub ]

  
# File 'activemodel/lib/active_model/secure_password.rb', line 29

def register_algorithm(name, algorithm_class)
  algorithm_registry[name.to_sym] = algorithm_class
end