Module: Algo::Dsl::Network

Included in:
Cluster::Context
Defined in:
lib/algo/dsl/network.rb

Defined Under Namespace

Classes: Context, IPAMContext

Instance Method Summary collapse

Instance Method Details

#network(name, &block) ⇒ Object



74
75
76
77
78
79
80
# File 'lib/algo/dsl/network.rb', line 74

def network name, &block
  raise 'should be called in cluster' unless @context
  ctx = Network::Context.new(name, @context).tap do |ctx|
    ctx.instance_eval(&block) if block_given?
  end
  @context['networks'] << ctx.context
end