doc/manual/parts/02_namespaces.txt in needle-0.9.0 vs doc/manual/parts/02_namespaces.txt in needle-1.0.0

- old
+ new

@@ -33,13 +33,22 @@ spc.register( :foo ) { Bar.new } ... end </pre> -And, to mirror the @namespace@ method, there is also a @namespace!@ method. This method creates a new namespace and then does a @define!@ call on that namespace. +If you prefer the @define@ approach to registering services, you may like @namespace_define@, which creates the new namespace and immediately calls @define@ on it: <pre> - registry.namespace! :stuff do + registry.namespace_define :stuff do |b| + b.foo { Bar.new } + ... + end +</pre> + +And, to mirror the @namespace_define@ method, there is also a @namespace_define!@ method. This method creates a new namespace and then does a @define!@ call on that namespace. + +<pre> + registry.namespace_define! :stuff do foo { Bar.new } ... end </pre>