Class: GraphQL::Groups::GroupTypeRegistry
- Inherits:
-
Object
- Object
- GraphQL::Groups::GroupTypeRegistry
- Includes:
- Singleton
- Defined in:
- lib/graphql/groups/group_type_registry.rb
Instance Attribute Summary collapse
-
#types ⇒ Object
readonly
Returns the value of attribute types.
Instance Method Summary collapse
- #clear ⇒ Object
- #get(type) ⇒ Object
-
#initialize ⇒ GroupTypeRegistry
constructor
A new instance of GroupTypeRegistry.
- #register(type, derived) ⇒ Object
Constructor Details
#initialize ⇒ GroupTypeRegistry
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
#types ⇒ Object (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
#clear ⇒ Object
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 |