Class: Diplomat::Configuration

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

Overview

Methods for configuring Diplomat

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url = 'http://localhost:8500', acl_token = nil, options = {}) ⇒ Configuration

Override defaults for configuration

Parameters:

  • url (String) (defaults to: 'http://localhost:8500')

    consul’s connection URL

  • acl_token (String) (defaults to: nil)

    a connection token used when making requests to consul

  • options (Hash) (defaults to: {})

    extra options to configure Faraday::Connection



11
12
13
14
15
16
# File 'lib/diplomat/configuration.rb', line 11

def initialize(url = 'http://localhost:8500', acl_token = nil, options = {})
  @middleware = []
  @url = url
  @acl_token = acl_token
  @options = options
end

Instance Attribute Details

#acl_tokenObject

Returns the value of attribute acl_token.



5
6
7
# File 'lib/diplomat/configuration.rb', line 5

def acl_token
  @acl_token
end

#middlewareObject

Returns the value of attribute middleware.



4
5
6
# File 'lib/diplomat/configuration.rb', line 4

def middleware
  @middleware
end

#optionsObject

Returns the value of attribute options.



5
6
7
# File 'lib/diplomat/configuration.rb', line 5

def options
  @options
end

#urlObject

Returns the value of attribute url.



5
6
7
# File 'lib/diplomat/configuration.rb', line 5

def url
  @url
end