Class: Consul::Template::Generator::Configuration
- Inherits:
-
Object
- Object
- Consul::Template::Generator::Configuration
- Defined in:
- lib/consul/template/generator/configuration.rb
Instance Attribute Summary collapse
-
#client_options ⇒ Object
Returns the value of attribute client_options.
-
#consul_host ⇒ Object
Returns the value of attribute consul_host.
-
#consul_template_binary ⇒ Object
Returns the value of attribute consul_template_binary.
-
#log_level ⇒ Object
Returns the value of attribute log_level.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#node ⇒ Object
Returns the value of attribute node.
-
#session_key ⇒ Object
Returns the value of attribute session_key.
-
#templates ⇒ Object
Returns the value of attribute templates.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #lock_key(key) ⇒ Object
- #session_lock_key ⇒ Object
- #session_name ⇒ Object
Constructor Details
#initialize ⇒ Configuration
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' = {} @logger = Consul::Template::Generator::STDLogger end |
Instance Attribute Details
#client_options ⇒ Object
Returns the value of attribute client_options.
43 44 45 |
# File 'lib/consul/template/generator/configuration.rb', line 43 def end |
#consul_host ⇒ Object
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_binary ⇒ Object
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_level ⇒ Object
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 |
#logger ⇒ Object
Returns the value of attribute logger.
42 43 44 |
# File 'lib/consul/template/generator/configuration.rb', line 42 def logger @logger end |
#node ⇒ Object
Returns the value of attribute node.
43 44 45 |
# File 'lib/consul/template/generator/configuration.rb', line 43 def node @node end |
#session_key ⇒ Object
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 |
#templates ⇒ Object
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_key ⇒ Object
59 60 61 |
# File 'lib/consul/template/generator/configuration.rb', line 59 def session_lock_key @session_key end |
#session_name ⇒ Object
63 64 65 |
# File 'lib/consul/template/generator/configuration.rb', line 63 def session_name @session_key.split('/')[-1] end |