class Stattleship::Validators::LevelValidator

Constants

VALID_LEVELS

Public Instance Methods

validate() click to toggle source
# File lib/stattleship/validators/level_validator.rb, line 6
def validate
  if VALID_LEVELS.include?(value)
    return
  else
    fail ArgumentError.
      new("expected #{key} to be either #{VALID_LEVELS.join(', ')}")
  end
end