Class: SimpleRecord::PasswordHashed

Inherits:
Object
  • Object
show all
Defined in:
lib/simple_record/translations.rb

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ PasswordHashed

Returns a new instance of PasswordHashed.



254
255
256
# File 'lib/simple_record/translations.rb', line 254

def initialize(value)
    @value = value
end

Instance Method Details

#==(val) ⇒ Object

This allows you to compare an unhashed string to the hashed one.



263
264
265
266
267
268
# File 'lib/simple_record/translations.rb', line 263

def ==(val)
    if val.is_a?(PasswordHashed)
        return val.hashed_value == self.hashed_value
    end
    return Translations.pass_hash_check(@value, val)
end

#hashed_valueObject



258
259
260
# File 'lib/simple_record/translations.rb', line 258

def hashed_value
    @value
end

#to_sObject



270
271
272
# File 'lib/simple_record/translations.rb', line 270

def to_s
    @value
end