Class: SimpleRecord::PasswordHashed
- Inherits:
-
Object
- Object
- SimpleRecord::PasswordHashed
- Defined in:
- lib/simple_record/translations.rb
Instance Method Summary collapse
-
#==(val) ⇒ Object
This allows you to compare an unhashed string to the hashed one.
- #hashed_value ⇒ Object
-
#initialize(value) ⇒ PasswordHashed
constructor
A new instance of PasswordHashed.
- #to_s ⇒ Object
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_value ⇒ Object
289 290 291 |
# File 'lib/simple_record/translations.rb', line 289 def hashed_value @value end |
#to_s ⇒ Object
301 302 303 |
# File 'lib/simple_record/translations.rb', line 301 def to_s @value end |