Class: Incognia::Configuration

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/incognia_api/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#client_idObject

Returns the value of attribute client_id.



7
8
9
# File 'lib/incognia_api/configuration.rb', line 7

def client_id
  @client_id
end

#client_secretObject

Returns the value of attribute client_secret.



7
8
9
# File 'lib/incognia_api/configuration.rb', line 7

def client_secret
  @client_secret
end

#hostObject

Returns the value of attribute host.



7
8
9
# File 'lib/incognia_api/configuration.rb', line 7

def host
  @host
end

#keep_aliveObject

Returns the value of attribute keep_alive.



7
8
9
# File 'lib/incognia_api/configuration.rb', line 7

def keep_alive
  @keep_alive
end

#max_connectionsObject

Returns the value of attribute max_connections.



7
8
9
# File 'lib/incognia_api/configuration.rb', line 7

def max_connections
  @max_connections
end

Instance Method Details

#configure(client_id:, client_secret:, host: nil, keep_alive: false, max_connections: nil) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/incognia_api/configuration.rb', line 9

def configure(client_id:, client_secret:, host: nil, keep_alive: false, max_connections: nil)
  validate_connection_settings!(keep_alive: keep_alive, max_connections: max_connections)

  @client_id = client_id
  @client_secret = client_secret
  @host = host || 'https://api.incognia.com/api'
  @keep_alive = keep_alive
  @max_connections = max_connections

  self
end