Class: Dryad::Configuration

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

Constant Summary collapse

DEFAULT_OPTIONS =
{
  consul: {
    host: '127.0.0.1',
    port: 8500
  },
  service: {}
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ Configuration

Returns a new instance of Configuration.



13
14
15
16
17
18
19
20
21
# File 'lib/dryad/configuration.rb', line 13

def initialize(opts = {})
  opts = DEFAULT_OPTIONS.merge(opts)
  @consul = opts[:consul]
  @namespace = opts[:namespace]
  @group = opts[:group]
  @registry = opts[:registry]
  @provider = opts[:provider]
  @service = opts[:service]
end

Instance Attribute Details

#consulObject

Returns the value of attribute consul.



3
4
5
# File 'lib/dryad/configuration.rb', line 3

def consul
  @consul
end

#groupObject

Returns the value of attribute group.



3
4
5
# File 'lib/dryad/configuration.rb', line 3

def group
  @group
end

#namespaceObject

Returns the value of attribute namespace.



3
4
5
# File 'lib/dryad/configuration.rb', line 3

def namespace
  @namespace
end

#providerObject

Returns the value of attribute provider.



3
4
5
# File 'lib/dryad/configuration.rb', line 3

def provider
  @provider
end

#registryObject

Returns the value of attribute registry.



3
4
5
# File 'lib/dryad/configuration.rb', line 3

def registry
  @registry
end

#serviceObject

Returns the value of attribute service.



3
4
5
# File 'lib/dryad/configuration.rb', line 3

def service
  @service
end