Module: DataMapper::Validate::ValidatesIsPrimitive

Module | DataMapper::Validate::ValidatesIsPrimitive
In: | lib/dm-validations/primitive_validator.rb

### Methods

validates_is_primitive

### Public Instance methods

validates_is_primitive(*fields)

Validates that the specified attribute is of the correct primitive type.

@example [Usage]

      require 'dm-validations'

      class Person
        include DataMapper::Resource

        property :birth_date, Date

        validates_is_primitive :birth_date

        # a call to valid? will return false unless
        # the birth_date is something that can be properly
        # casted into a Date object.
      end

[Validate]