class Hermod::Validators::Base

def message(value, attributes)

Returns a string

Private: override in subclasses to provide a more useful error message
def message(value, attributes)
  "is invalid"
end

def test(value, attributes)

Returns a boolean

validator
Private: override in subclasses to implement the logic for that
def test(value, attributes)
  raise NotImplementedError
end

def valid?(value, attributes)

Returns true if it succeeds
Raises a Hermod::InvalidInputError if the test fails

raising if it fails
Public: Runs the test for the validator returning true if it passes and
def valid?(value, attributes)
  !!test(value, attributes) || raise(InvalidInputError, message(value, attributes))
end