Module: CopDetective::ErrorMessages
- Included in:
- CopDetectiveValidator
- Defined in:
- lib/errors.rb
Class Method Summary collapse
- .formatting ⇒ Object
- .invalid_password ⇒ Object
- .non_matching ⇒ Object
- .options_error(key) ⇒ Object
- .unsaved_password(reason) ⇒ Object
- .wrong_datatype ⇒ Object
Class Method Details
.formatting ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/errors.rb', line 16 def formatting <<-MESSAGE The keys in the hash you pass to #set_keys must be as follows: password: confirmation: old_password: the values you pass should reflect keys in your params hash. a correctly configured hash would look similar to this: { password: :new_password, confirmation: :password_again, old_password: :original_password } MESSAGE end |
.invalid_password ⇒ Object
8 9 10 |
# File 'lib/errors.rb', line 8 def invalid_password "You entered your original password incorrectly." end |
.non_matching ⇒ Object
33 34 35 |
# File 'lib/errors.rb', line 33 def non_matching "Your new passwords don't match." end |
.options_error(key) ⇒ Object
37 38 39 |
# File 'lib/errors.rb', line 37 def (key) "Option passed to #{key} must be a symbol or string." end |
.unsaved_password(reason) ⇒ Object
4 5 6 |
# File 'lib/errors.rb', line 4 def unsaved_password(reason) "Your new password was not saved. #{reason}" end |
.wrong_datatype ⇒ Object
12 13 14 |
# File 'lib/errors.rb', line 12 def wrong_datatype 'You must pass a hash to the set_keys method' end |