Class DataMapper::Validations::LengthValidator
In: lib/dm-validations/validators/length_validator.rb
Parent: GenericValidator

Methods

call   new  

Public Class methods

Initialize a length validator

@param [Symbol] field_name

  the name of the field to validate

@param [Hash] options

  the validator options

@api semipublic

Public Instance methods

Test the resource field for validity

@example when the resource field is valid

  validator.call(valid_resource)  # => true

@example when the resource field is not valid

  validator.call(invalid_resource)  # => false

@param [Resource] target

  the Resource to test

@return [Boolean]

  true if the field is valid, false if not

@api semipublic

[Validate]