Class: GraphqlConnector::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/graphql_connector/configuration.rb

Overview

The configuration template file for the gem.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



8
9
10
# File 'lib/graphql_connector/configuration.rb', line 8

def initialize
  @base_server_types = {}
end

Instance Attribute Details

#base_server_typesObject (readonly)

Returns the value of attribute base_server_types.



6
7
8
# File 'lib/graphql_connector/configuration.rb', line 6

def base_server_types
  @base_server_types
end

Instance Method Details

#add_server(name:, uri:, headers: {}, connector: {}, httparty_adapter_options: {}) ⇒ Object



12
13
14
15
# File 'lib/graphql_connector/configuration.rb', line 12

def add_server(name:, uri:, headers: {}, connector: {}, httparty_adapter_options: {})
  @base_server_types[name] =
    BaseServerType.build(name, uri, headers, connector, httparty_adapter_options)
end

#reset!Object



17
18
19
20
21
22
23
# File 'lib/graphql_connector/configuration.rb', line 17

def reset!
  @base_server_types.keys.each do |name|
    GraphqlConnector.const_get(name).send :remove_const, 'Query'
    GraphqlConnector.send :remove_const, name
  end
  @base_server_types = {}
end