Class: DailyAffirmation::Validators::AcceptanceValidator
- Inherits:
-
DailyAffirmation::Validator
- Object
- DailyAffirmation::Validator
- DailyAffirmation::Validators::AcceptanceValidator
- Defined in:
- lib/daily_affirmation/validators/acceptance_validator.rb
Overview
This affrimation ensures an attribute is true.
Instance Method Summary collapse
Methods inherited from DailyAffirmation::Validator
Constructor Details
This class inherits a constructor from DailyAffirmation::Validator
Instance Method Details
#error_message ⇒ Object
11 12 13 14 15 |
# File 'lib/daily_affirmation/validators/acceptance_validator.rb', line 11 def @error_message ||= ( :acceptance, :default => "#{attribute} must be accepted" ) end |
#valid? ⇒ Boolean
7 8 9 |
# File 'lib/daily_affirmation/validators/acceptance_validator.rb', line 7 def valid? @valid ||= !!value end |