Class: GraphQL::Groups::GroupTypeRegistry

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/graphql/groups/group_type_registry.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeGroupTypeRegistry

Returns a new instance of GroupTypeRegistry.



12
13
14
# File 'lib/graphql/groups/group_type_registry.rb', line 12

def initialize
  @types = {}
end

Instance Attribute Details

#typesObject (readonly)

Returns the value of attribute types.



10
11
12
# File 'lib/graphql/groups/group_type_registry.rb', line 10

def types
  @types
end

Instance Method Details

#clearObject



16
17
18
# File 'lib/graphql/groups/group_type_registry.rb', line 16

def clear
  @types = {}
end

#get(type) ⇒ Object



24
25
26
# File 'lib/graphql/groups/group_type_registry.rb', line 24

def get(type)
  types[type]
end

#register(type, derived) ⇒ Object



20
21
22
# File 'lib/graphql/groups/group_type_registry.rb', line 20

def register(type, derived)
  types[type] = derived
end