Class: DailyAffirmation::Validators::DateValidator
- Inherits:
-
DailyAffirmation::Validator
- Object
- DailyAffirmation::Validator
- DailyAffirmation::Validators::DateValidator
- Defined in:
- lib/daily_affirmation/validators/date_validator.rb
Overview
This affirmation ensures an attribute is a date and if a :before or :after option is given, that the attribute is before or after the selected date.
Defined Under Namespace
Classes: NullDateLike
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
23 24 25 26 27 |
# File 'lib/daily_affirmation/validators/date_validator.rb', line 23 def @error_message ||= ( :format, :default => "#{attribute} is not a valid #{as}" ) end |
#valid? ⇒ Boolean
19 20 21 |
# File 'lib/daily_affirmation/validators/date_validator.rb', line 19 def valid? @valid ||= parseable? && before? && after? end |