Module: Algo::Dsl::Service

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

Defined Under Namespace

Classes: Context, VolumeContext

Instance Method Summary collapse

Instance Method Details

#service(name, &block) ⇒ Object



273
274
275
276
277
278
279
# File 'lib/algo/dsl/service.rb', line 273

def service name, &block
  raise 'should be called in cluster' unless @context
  ctx = Service::Context.new(name, @context).tap do |ctx|
    ctx.instance_eval(&block)
  end
  @context['services'] << ctx.context
end