Parent

DataMapper::Property::BCryptHash

Public Instance Methods

dump(value) click to toggle source
    # File lib/dm-types/bcrypt_hash.rb, line 24
24:       def dump(value)
25:         load(value)
26:       end
load(value) click to toggle source
    # File lib/dm-types/bcrypt_hash.rb, line 14
14:       def load(value)
15:         unless value.nil?
16:           begin
17:             primitive?(value) ? value : BCrypt::Password.new(value)
18:           rescue BCrypt::Errors::InvalidHash
19:             BCrypt::Password.create(value, :cost => BCrypt::Engine::DEFAULT_COST)
20:           end
21:         end
22:       end
primitive?(value) click to toggle source
    # File lib/dm-types/bcrypt_hash.rb, line 10
10:       def primitive?(value)
11:         value.kind_of?(BCrypt::Password)
12:       end
typecast_to_primitive(value) click to toggle source
    # File lib/dm-types/bcrypt_hash.rb, line 28
28:       def typecast_to_primitive(value)
29:         load(value)
30:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.