123456789_123456789_123456789_123456789_123456789_

Module: ActiveModel::Type

Class Attribute Summary

Class Method Summary

Class Attribute Details

.registry (rw)

This method is for internal use only.
[ GitHub ]

  
# File 'activemodel/lib/active_model/type.rb', line 26

attr_accessor :registry # :nodoc:

Class Method Details

.default_value

This method is for internal use only.
[ GitHub ]

  
# File 'activemodel/lib/active_model/type.rb', line 38

def default_value # :nodoc:
  @default_value ||= Value.new
end

.lookup

This method is for internal use only.
[ GitHub ]

  
# File 'activemodel/lib/active_model/type.rb', line 34

def lookup(...) # :nodoc:
  registry.lookup(...)
end

.register(type_name, klass = nil, &block)

Add a new type to the registry, allowing it to be referenced as a symbol by attribute.

[ GitHub ]

  
# File 'activemodel/lib/active_model/type.rb', line 30

def register(type_name, klass = nil, &block)
  registry.register(type_name, klass, &block)
end