Class: GraphQL::Client::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/graphql_client/config.rb

Constant Summary collapse

DEFAULTS =
{
  debug: false,
  headers: {},
  per_page: 100,
  open_timeout: 5,
  read_timeout: 5
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Config

Returns a new instance of Config.



25
26
27
28
29
30
31
32
33
34
35
# File 'lib/graphql_client/config.rb', line 25

def initialize(options = {})
  @options = DEFAULTS.merge(options)
  @debug = @options[:debug]
  @headers = @options[:headers]
  @per_page = @options[:per_page]
  @password = @options[:password]
  @username = @options[:username]
  @open_timeout = @options[:open_timeout]
  @read_timeout = @options[:read_timeout]
  @url = URI(@options[:url]) if @options[:url]
end

Instance Attribute Details

#debugObject

Returns the value of attribute debug.



6
7
8
# File 'lib/graphql_client/config.rb', line 6

def debug
  @debug
end

#headersObject

Returns the value of attribute headers.



6
7
8
# File 'lib/graphql_client/config.rb', line 6

def headers
  @headers
end

#open_timeoutObject

Returns the value of attribute open_timeout.



6
7
8
# File 'lib/graphql_client/config.rb', line 6

def open_timeout
  @open_timeout
end

#passwordObject

Returns the value of attribute password.



6
7
8
# File 'lib/graphql_client/config.rb', line 6

def password
  @password
end

#per_pageObject

Returns the value of attribute per_page.



6
7
8
# File 'lib/graphql_client/config.rb', line 6

def per_page
  @per_page
end

#read_timeoutObject

Returns the value of attribute read_timeout.



6
7
8
# File 'lib/graphql_client/config.rb', line 6

def read_timeout
  @read_timeout
end

#urlObject

Returns the value of attribute url.



6
7
8
# File 'lib/graphql_client/config.rb', line 6

def url
  @url
end

#usernameObject

Returns the value of attribute username.



6
7
8
# File 'lib/graphql_client/config.rb', line 6

def username
  @username
end