Class: GraphQL::Client::Config
- Inherits:
-
Object
- Object
- GraphQL::Client::Config
- 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
-
#debug ⇒ Object
Returns the value of attribute debug.
-
#headers ⇒ Object
Returns the value of attribute headers.
-
#open_timeout ⇒ Object
Returns the value of attribute open_timeout.
-
#password ⇒ Object
Returns the value of attribute password.
-
#per_page ⇒ Object
Returns the value of attribute per_page.
-
#read_timeout ⇒ Object
Returns the value of attribute read_timeout.
-
#url ⇒ Object
Returns the value of attribute url.
-
#username ⇒ Object
Returns the value of attribute username.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Config
constructor
A new instance of Config.
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 = DEFAULTS.merge() @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
#debug ⇒ Object
Returns the value of attribute debug.
6 7 8 |
# File 'lib/graphql_client/config.rb', line 6 def debug @debug end |
#headers ⇒ Object
Returns the value of attribute headers.
6 7 8 |
# File 'lib/graphql_client/config.rb', line 6 def headers @headers end |
#open_timeout ⇒ Object
Returns the value of attribute open_timeout.
6 7 8 |
# File 'lib/graphql_client/config.rb', line 6 def open_timeout @open_timeout end |
#password ⇒ Object
Returns the value of attribute password.
6 7 8 |
# File 'lib/graphql_client/config.rb', line 6 def password @password end |
#per_page ⇒ Object
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_timeout ⇒ Object
Returns the value of attribute read_timeout.
6 7 8 |
# File 'lib/graphql_client/config.rb', line 6 def read_timeout @read_timeout end |
#url ⇒ Object
Returns the value of attribute url.
6 7 8 |
# File 'lib/graphql_client/config.rb', line 6 def url @url end |
#username ⇒ Object
Returns the value of attribute username.
6 7 8 |
# File 'lib/graphql_client/config.rb', line 6 def username @username end |