Class: Sumaki::Model::Fields::Type::Types

Inherits:
Object
  • Object
show all
Defined in:
lib/sumaki/model/fields/type.rb

Overview

:nodoc:

Instance Method Summary collapse

Constructor Details

#initializeTypes

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