lib/lbrt/service/dsl/context/service.rb in lbrt-0.1.4 vs lib/lbrt/service/dsl/context/service.rb in lbrt-0.1.5

- old
+ new

@@ -1,15 +1,20 @@ class Lbrt::Service::DSL::Context::Service + include Lbrt::Utils::TemplateHelper + REQUIRED_ATTRIBUTES = %w( settings ) - def initialize(type, title, &block) + def initialize(context, type, title, &block) + @context = context.merge(:service_type => type, :service_title => title) @type = type @title = title @result = {} instance_eval(&block) end + + attr_reader :context def result REQUIRED_ATTRIBUTES.each do |name| unless @result.has_key?(name) raise "Service `#{@type}/#{@title}`: #{name} is not defined"