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.



287
288
289
# File 'lib/simple_record/translations.rb', line 287

def initialize(value)
  @value = value
end

Instance Method Details

#==(val) ⇒ Object

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



296
297
298
299
300
301
# File 'lib/simple_record/translations.rb', line 296

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



291
292
293
# File 'lib/simple_record/translations.rb', line 291

def hashed_value
  @value
end

#to_sObject



303
304
305
# File 'lib/simple_record/translations.rb', line 303

def to_s
  @value
end