Class: DailyAffirmation::Validators::ExclusionValidator
- Inherits:
-
DailyAffirmation::Validator
- Object
- DailyAffirmation::Validator
- DailyAffirmation::Validators::ExclusionValidator
- Defined in:
- lib/daily_affirmation/validators/exclusion_validator.rb
Overview
This affirmation ensures an attribute is not in the provided :list option.
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
16 17 18 19 20 |
# File 'lib/daily_affirmation/validators/exclusion_validator.rb', line 16 def @error_message ||= ( :exclusion, :default => "#{attribute} is reserved" ) end |
#valid? ⇒ Boolean
12 13 14 |
# File 'lib/daily_affirmation/validators/exclusion_validator.rb', line 12 def valid? @valid ||= !InclusionValidator.new(object, attribute, opts).valid? end |