module Validators
  module FieldValidator
    class Base

      def initialize model, field
        @model = model
        @field = field
        @value = model.send(field)
      end

      def validate!
        raise InvalidRecord.new(self.message) unless self.valid?
        true
      end

      def valid?
        raise 'override me'
      end

      def message
        raise 'override me'
      end
    end
  end
end

