Module: Diplomat

Defined in:
lib/diplomat.rb,
lib/diplomat/kv.rb,
lib/diplomat/acl.rb,
lib/diplomat/lock.rb,
lib/diplomat/node.rb,
lib/diplomat/role.rb,
lib/diplomat/agent.rb,
lib/diplomat/check.rb,
lib/diplomat/error.rb,
lib/diplomat/event.rb,
lib/diplomat/nodes.rb,
lib/diplomat/query.rb,
lib/diplomat/token.rb,
lib/diplomat/health.rb,
lib/diplomat/policy.rb,
lib/diplomat/status.rb,
lib/diplomat/members.rb,
lib/diplomat/service.rb,
lib/diplomat/session.rb,
lib/diplomat/version.rb,
lib/diplomat/autopilot.rb,
lib/diplomat/datacenter.rb,
lib/diplomat/maintenance.rb,
lib/diplomat/rest_client.rb,
lib/diplomat/configuration.rb

Overview

Top level namespace ensures all required libraries are included and initializes the gem configration.

Defined Under Namespace

Classes: AccessorIdParameterRequired, Acl, AclAlreadyExists, AclNotFound, Agent, Autopilot, Check, Configuration, Datacenter, DeprecatedArgument, Event, EventAlreadyExists, EventNotFound, Health, IdParameterRequired, InvalidTransaction, KeyAlreadyExists, KeyNotFound, Kv, Lock, Maintenance, Members, NameParameterRequired, Node, Nodes, PathNotFound, Policy, PolicyAlreadyExists, PolicyMalformed, PolicyNotFound, Query, QueryAlreadyExists, QueryNotFound, RestClient, Role, RoleMalformed, RoleNotFound, Service, Session, Status, Token, TokenMalformed, UnknownStatus

Constant Summary collapse

VERSION =
'2.6.3'

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configurationObject

Returns the value of attribute configuration.


12
13
14
# File 'lib/diplomat.rb', line 12

def configuration
  @configuration
end

.lib_pathObject

Returns the value of attribute lib_path.


11
12
13
# File 'lib/diplomat.rb', line 11

def lib_path
  @lib_path
end

.root_pathObject

Returns the value of attribute root_path.


10
11
12
# File 'lib/diplomat.rb', line 10

def root_path
  @root_path
end

Class Method Details

.configure {|Diplomat::Configuration| ... } ⇒ Object

Build optional configuration by yielding a block to configure


40
41
42
43
# File 'lib/diplomat.rb', line 40

def configure
  self.configuration ||= Diplomat::Configuration.new
  yield(configuration)
end

.require_libs(*libs) ⇒ nil Also known as: require_lib

Internal: Requires internal Faraday libraries.

Parameters:

  • *libs

    One or more relative String names to Faraday classes.

Returns:

  • (nil)

17
18
19
20
21
# File 'lib/diplomat.rb', line 17

def require_libs(*libs)
  libs.each do |lib|
    require "#{lib_path}/#{lib}"
  end
end