Method: Chef::Node#namespace
- Defined in:
- lib/chef/sugar/node.rb
#namespace(*args, &block) ⇒ nil
Dynamically define the current namespace. Multiple namespaces may be nested.
142 143 144 145 146 147 148 149 150 151 152 153 154 |
# File 'lib/chef/sugar/node.rb', line 142 def namespace(*args, &block) = { precedence: default }.merge(args.last.is_a?(Hash) ? args.pop : {}) keys = args.map(&:to_s) @current_namespace = current_namespace + keys instance_eval(&block) @current_namespace = current_namespace - keys nil end |