 # @example:
 #  value : presence: true
 class PresenceValidator extends Validator
+  #@param [Any] value
+  #@param [Boolean] attributes
+  #@return [Boolean]
   validate: (value, attributes = true) ->
     if value
       true

# @example
#   name: inclusion: {within: ["A", "B, "C"]}
class InclusionValidator extends Validator
  validate: (value, attributes) ->
    range = attributes['within'] || []
    if range.indexOf(value) > -1

#   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)
