Class: AocCli::Validators::EventYearValidator
- Inherits:
-
Kangaru::Validator
- Object
- Kangaru::Validator
- AocCli::Validators::EventYearValidator
- Defined in:
- lib/aoc_cli/validators/event_year_validator.rb
Instance Method Summary collapse
Instance Method Details
#validate ⇒ Object
4 5 6 7 8 9 10 |
# File 'lib/aoc_cli/validators/event_year_validator.rb', line 4 def validate case value when Integer then validate_year! when NilClass then add_error!(ERRORS[:blank]) else add_error!(ERRORS[:invalid]) end end |