Sha256: a00fbc7c23fbe63805db06aa2517fa6603e6eb8297de2242f920a989bb1851ae

Contents?: true

Size: 422 Bytes

Versions: 1

Compression:

Stored size: 422 Bytes

Contents

ValidationError = require "hoarder/validator/error/validation_error"

#
# @author - Tim Shelburne <tim@musiconelive.com>
#
# 
#
class MinLengthConstraint
  canHandle: (type)->
    type is "minLength"

  handle: (element, context)->
    if element.value.length >= context.value
      return []
    else
      return [ new ValidationError "The minimum length of this field is #{context.value}." ]

return MinLengthConstraint

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hoarder-js-0.0.1 assets/scripts/coffee/hoarder/validator/constraints/min_length_constraint.coffee