class Ardm::Property::BCryptHash

Public Instance Methods

dump(value) click to toggle source
# File lib/ardm/property/bcrypt_hash.rb, line 21
def dump(value)
  load(value)
end
load(value) click to toggle source
# File lib/ardm/property/bcrypt_hash.rb, line 11
def load(value)
  unless value.nil?
    begin
      value_loaded?(value) ? value : BCrypt::Password.new(value)
    rescue BCrypt::Errors::InvalidHash
      BCrypt::Password.create(value, :cost => BCrypt::Engine::DEFAULT_COST)
    end
  end
end
typecast(value) click to toggle source
# File lib/ardm/property/bcrypt_hash.rb, line 25
def typecast(value)
  load(value)
end