Class: Porkadot::Assets::EtcdList
- Inherits:
-
Object
- Object
- Porkadot::Assets::EtcdList
- Defined in:
- lib/porkadot/assets/etcd.rb
Instance Attribute Summary collapse
-
#global_config ⇒ Object
readonly
Returns the value of attribute global_config.
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
-
#nodes ⇒ Object
readonly
Returns the value of attribute nodes.
Instance Method Summary collapse
- #[](name) ⇒ Object
-
#initialize(global_config) ⇒ EtcdList
constructor
A new instance of EtcdList.
- #render ⇒ Object
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_config ⇒ Object (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 |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
9 10 11 |
# File 'lib/porkadot/assets/etcd.rb', line 9 def logger @logger end |
#nodes ⇒ Object (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 |
#render ⇒ Object
21 22 23 24 25 |
# File 'lib/porkadot/assets/etcd.rb', line 21 def render self.nodes.each do |_, v| v.render end end |