Sha256: 87d95089c912097efeb7dc4c2d9ab17b74dc9e71a4d5c6fcd07ae5aa14f7aca0

Contents?: true

Size: 404 Bytes

Versions: 4

Compression:

Stored size: 404 Bytes

Contents

# frozen_string_literal: true

require 'singleton'

module GraphQL
  module Groups
    class GroupTypeRegistry
      include Singleton

      attr_reader :types

      def initialize
        @types = {}
      end

      def clear
        @types = {}
      end

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

      def get(type)
        types[type]
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
graphql-groups-0.2.3 lib/graphql/groups/group_type_registry.rb
graphql-groups-0.2.2 lib/graphql/groups/group_type_registry.rb
graphql-groups-0.2.1 lib/graphql/groups/group_type_registry.rb
graphql-groups-0.2.0 lib/graphql/groups/group_type_registry.rb