Class: Porkadot::Assets::EtcdList

Inherits:
Object
  • Object
show all
Defined in:
lib/porkadot/assets/etcd.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(global_config) ⇒ EtcdList

Returns a new instance of EtcdList.



12
13
14
15
16
17
18
19
# File 'lib/porkadot/assets/etcd.rb', line 12

def initialize global_config
  @global_config = global_config
  @logger = global_config.logger
  @nodes = {}
  global_config.etcd_nodes.each do |k, config|
    @nodes[k] = EtcdNode.new(config)
  end
end

Instance Attribute Details

#global_configObject (readonly)

Returns the value of attribute global_config.



8
9
10
# File 'lib/porkadot/assets/etcd.rb', line 8

def global_config
  @global_config
end

#loggerObject (readonly)

Returns the value of attribute logger.



9
10
11
# File 'lib/porkadot/assets/etcd.rb', line 9

def logger
  @logger
end

#nodesObject (readonly)

Returns the value of attribute nodes.



10
11
12
# File 'lib/porkadot/assets/etcd.rb', line 10

def nodes
  @nodes
end

Instance Method Details

#[](name) ⇒ Object



27
28
29
# File 'lib/porkadot/assets/etcd.rb', line 27

def [](name)
  self.nodes[name]
end

#renderObject



21
22
23
24
25
# File 'lib/porkadot/assets/etcd.rb', line 21

def render
  self.nodes.each do |_, v|
    v.render
  end
end