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.



285
286
287
# File 'lib/simple_record/translations.rb', line 285

def initialize(value)
  @value = value
end

Instance Method Details

#==(val) ⇒ Object

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



294
295
296
297
298
299
# File 'lib/simple_record/translations.rb', line 294

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



289
290
291
# File 'lib/simple_record/translations.rb', line 289

def hashed_value
  @value
end

#to_sObject



301
302
303
# File 'lib/simple_record/translations.rb', line 301

def to_s
  @value
end