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

Returns a new instance of Configuration.



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

def initialize
  @log_level = :debug
  @node = nil
  @consul_host = nil
  @templates = {}
  @graphite_paths = {}
  @session_key = 'consul-template-generator'
  @session_ttl = 30
  @client_options = {}
  @logger = Consul::Template::Generator::STDLogger
  @graphite_host = nil
  @diff_changes = false
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

#diff_changesObject

Returns the value of attribute diff_changes.



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

def diff_changes
  @diff_changes
end

#graphite_hostObject

Returns the value of attribute graphite_host.



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

def graphite_host
  @graphite_host
end

#graphite_pathsObject

Returns the value of attribute graphite_paths.



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

def graphite_paths
  @graphite_paths
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

#session_ttlObject

Returns the value of attribute session_ttl.



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

def session_ttl
  @session_ttl
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



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

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

#session_lock_keyObject



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

def session_lock_key
  @session_key
end

#session_nameObject



67
68
69
# File 'lib/consul/template/generator/configuration.rb', line 67

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