Class: Consul::Template::Generator::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/consul/template/generator/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration



45
46
47
48
49
50
51
52
53
# File 'lib/consul/template/generator/configuration.rb', line 45

def initialize
  @log_level = :debug
  @node = nil
  @consul_host = nil
  @templates = {}
  @session_key = 'consul-template-generator'
  @client_options = {}
  @logger = Consul::Template::Generator::STDLogger
end

Instance Attribute Details

#client_optionsObject

Returns the value of attribute client_options.



43
44
45
# File 'lib/consul/template/generator/configuration.rb', line 43

def client_options
  @client_options
end

#consul_hostObject

Returns the value of attribute consul_host.



43
44
45
# File 'lib/consul/template/generator/configuration.rb', line 43

def consul_host
  @consul_host
end

#consul_template_binaryObject

Returns the value of attribute consul_template_binary.



42
43
44
# File 'lib/consul/template/generator/configuration.rb', line 42

def consul_template_binary
  @consul_template_binary
end

#log_levelObject

Returns the value of attribute log_level.



42
43
44
# File 'lib/consul/template/generator/configuration.rb', line 42

def log_level
  @log_level
end

#loggerObject

Returns the value of attribute logger.



42
43
44
# File 'lib/consul/template/generator/configuration.rb', line 42

def logger
  @logger
end

#nodeObject

Returns the value of attribute node.



43
44
45
# File 'lib/consul/template/generator/configuration.rb', line 43

def node
  @node
end

#session_keyObject

Returns the value of attribute session_key.



42
43
44
# File 'lib/consul/template/generator/configuration.rb', line 42

def session_key
  @session_key
end

#templatesObject

Returns the value of attribute templates.



42
43
44
# File 'lib/consul/template/generator/configuration.rb', line 42

def templates
  @templates
end

Instance Method Details

#lock_key(key) ⇒ Object



55
56
57
# File 'lib/consul/template/generator/configuration.rb', line 55

def lock_key(key)
  "/lock/#{key.sub(/^\//, '')}"
end

#session_lock_keyObject



59
60
61
# File 'lib/consul/template/generator/configuration.rb', line 59

def session_lock_key
  @session_key
end

#session_nameObject



63
64
65
# File 'lib/consul/template/generator/configuration.rb', line 63

def session_name
  @session_key.split('/')[-1]
end