Sha256: 9af2e794fe8988490ed8208ce832bbf4b33eaeaf34cb9c16215d5ca8486b9266
Contents?: true
Size: 634 Bytes
Versions: 15
Compression:
Stored size: 634 Bytes
Contents
require 'ardm/property/string' require 'bcrypt' module Ardm class Property class BCryptHash < String load_as BCrypt::Password length 60 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 def dump(value) load(value) end def typecast(value) load(value) end end # class BCryptHash end # class Property end # module Ardm
Version data entries
15 entries across 15 versions & 1 rubygems