 #   name: format: {with: /\w+/}
 #
 class FormatValidator extends Validator
+  #@param [Any] value
+  #@param [Object] attributes - object with [with] key and regexp
+  #@return [Boolean]
   validate: (value, attributes) ->
     format = attributes['with'] || throw new Error("format attribute required")
     if format.test(value)

# @example:
#  value : presence: true
class PresenceValidator extends Validator
  validate: (value, attributes = true) ->
    if value
      true

# @example
#   name: exclusion: {within: ["A", "B, "C"]}
class ExclusionValidator extends Validator
  #@param [Any] value
  #@param [Object] attributes - object with [within] key and range
  #@return [Boolean]
  validate: (value, attributes) ->
    range = attributes['within'] || []
    if range.indexOf(value) == -1
