 # @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: exclusion: {within: ["A", "B, "C"]}
class ExclusionValidator extends Validator
  validate: (value, attributes) ->
    range = attributes['within'] || []
    if range.indexOf(value) == -1

  error_message: () ->
    @msg


# validate length for attribute
# @example
#   name: length: {min : 3, max: 10}
#   title: length : {length: 10 }
class LengthValidator extends Validator
  #@param [Any] value - current value
  #@param [Object] attributes object with [mix, max, length] keys
  #@return [Boolean]
  validate: (value, attributes) ->
    max = attributes['max'] || Number.POSITIVE_INFINITY
    min = attributes['min'] || Number.NEGATIVE_INFINITY
