Module: Algo::Dsl::Service

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

Defined Under Namespace

Classes: Context

Instance Method Summary collapse

Instance Method Details

#service(name, &block) ⇒ Object



100
101
102
103
104
105
106
# File 'lib/algo/dsl/service.rb', line 100

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