struct Athena::ORM::Types::TypeRegistry
inherits Struct
#
Holds an instance of every known AORM::Types::Type, keyed by name.
The registry used by the ORM is available as AORM::Types::Type.type_registry, though types are usually registered through AORM::Types::Type.add_type.
Constructors#
.new(instances : Hash(::String, AORM::Types::Type) = {} of ::String => AORM::Types::Type)#
Creates a registry holding instances, keyed by name.
Methods#
#get(name : ::String) : AORM::Types::Type#
Returns the type registered as name.
Raises if no type is registered with that name.
#override(name : ::String, type : AORM::Types::Type) : Nil#
Replaces the type registered as name with type.
Raises if no type is registered with that name.
#register(name : ::String, type : AORM::Types::Type) : Nil#
Registers type as name.
Raises if a type is already registered with that name.