Class: AocCli::Validators::IntegerValidator

Inherits:
Kangaru::Validator
  • Object
show all
Defined in:
lib/aoc_cli/validators/integer_validator.rb

Instance Method Summary collapse

Instance Method Details

#validateObject



4
5
6
7
8
9
# File 'lib/aoc_cli/validators/integer_validator.rb', line 4

def validate
  return add_error!(ERRORS[:blank]) if value.nil?
  return add_error!(ERRORS[:type]) unless value.is_a?(Integer)

  validate_range! if params.keys.include?(:between)
end