Class: Leibniz::Infrastructure
- Inherits:
-
Object
- Object
- Leibniz::Infrastructure
- Defined in:
- lib/leibniz.rb
Instance Method Summary collapse
- #[](name) ⇒ Object
- #converge ⇒ Object
- #destroy ⇒ Object
-
#initialize(instances) ⇒ Infrastructure
constructor
A new instance of Infrastructure.
Constructor Details
#initialize(instances) ⇒ Infrastructure
Returns a new instance of Infrastructure.
31 32 33 34 35 36 |
# File 'lib/leibniz.rb', line 31 def initialize(instances) @nodes = Hash.new instances.each do |instance| @nodes[instance.name.sub(/^leibniz-/, '')] = Node.new(instance) end end |
Instance Method Details
#[](name) ⇒ Object
38 39 40 |
# File 'lib/leibniz.rb', line 38 def [](name) @nodes[name] end |
#converge ⇒ Object
42 43 44 |
# File 'lib/leibniz.rb', line 42 def converge @nodes.each_pair { |name, node| node.converge } end |
#destroy ⇒ Object
46 47 48 |
# File 'lib/leibniz.rb', line 46 def destroy @nodes.each_pair { |name, node| node.destroy } end |