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.
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_value ⇒ Object
258 259 260 |
# File 'lib/simple_record/translations.rb', line 258 def hashed_value @value end |
#to_s ⇒ Object
270 271 272 |
# File 'lib/simple_record/translations.rb', line 270 def to_s @value end |