Class DataMapper::Type
In: lib/dm-core/type.rb
Parent: Object

Methods

bind   configure   dump   inherited   load   nullable   options   primitive  

Constants

PROPERTY_OPTIONS = [ :accessor, :reader, :writer, :lazy, :default, :key, :serial, :field, :size, :length, :format, :index, :unique_index, :auto_validation, :validates, :unique, :precision, :scale, :min, :max, :allow_nil, :allow_blank, :required   Until cooperation of Property and Type does not change, each must have a separate list of options, because plugins (ex.: dm-validations) may want to extend one or the other, and expects no side effects

Public Class methods

A hook to allow types to extend or modify property it‘s bound to. Implementations are not supposed to modify the state of the type class, and should produce no side-effects on the type class.

Stub instance method for dumping

@param value [Object, nil] value to dump @param property [Property, nil] property the type is being used by

@return [Object] Dumped object

@api public

Stub instance method for loading

@param value [Object, nil] value to serialize @param property [Property, nil] property the type is being used by

@return [Object] Serialized object. Must be the same type as the Ruby primitive

@api public

Gives all the options set on this type

@return [Hash] with all options and their values set on this type

@api public

Ruby primitive type to use as basis for this type. See Property::PRIMITIVES for list of types.

@param primitive [Class, nil]

  The class for the primitive. If nil is passed in, it returns the
  current primitive

@return [Class] if the <primitive> param is nil, return the current primitive.

@api public

[Validate]