W3cubDocs

/Ruby on Rails 5.1

module ActiveModel::Type

Public Class Methods

register(type_name, klass = nil, **options, &block) Show source

Add a new type to the registry, allowing it to be get through ActiveModel::Type#lookup

# File activemodel/lib/active_model/type.rb, line 26
def register(type_name, klass = nil, **options, &block)
  registry.register(type_name, klass, **options, &block)
end

© 2004–2017 David Heinemeier Hansson
Licensed under the MIT License.