# module Devise::Models::Encryptable::ClassMethods

### Public Instance Methods

encryptor_class() click to toggle source

Returns the class for the configured encryptor.

    # File lib/devise/models/encryptable.rb, line 55
    def encryptor_class
      @encryptor_class ||= case encryptor
        when :bcrypt
          raise "In order to use bcrypt as encryptor, simply remove :encryptable from your devise model"
        when nil
          raise "You need to give an :encryptor as option in order to use :encryptable"
        else
          ::Devise::Encryptors.const_get(encryptor.to_s.classify)
      end
    end

password_salt() click to toggle source

    # File lib/devise/models/encryptable.rb, line 66
    def password_salt
      self.encryptor_class.salt(self.stretches)
    end