Class: Sumaki::Model::Fields::Type::Types
- Inherits:
-
Object
- Object
- Sumaki::Model::Fields::Type::Types
- Defined in:
- lib/sumaki/model/fields/type.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#initialize ⇒ Types
constructor
A new instance of Types.
- #lookup(type_name) ⇒ Object
- #register(name, type_class) ⇒ Object
Constructor Details
#initialize ⇒ Types
Returns a new instance of Types.
16 17 18 |
# File 'lib/sumaki/model/fields/type.rb', line 16 def initialize @types = {} end |
Instance Method Details
#lookup(type_name) ⇒ Object
24 25 26 |
# File 'lib/sumaki/model/fields/type.rb', line 24 def lookup(type_name) @types.fetch(type_name) end |
#register(name, type_class) ⇒ Object
20 21 22 |
# File 'lib/sumaki/model/fields/type.rb', line 20 def register(name, type_class) @types[name] = type_class end |