Module: ChefDK::Generator
- Defined in:
- lib/chef-dk/generator.rb
Defined Under Namespace
Modules: TemplateHelper
Classes: Context
Class Method Summary
collapse
Class Method Details
.add_attr_to_context(name, value = nil) ⇒ Object
37
38
39
40
41
42
|
# File 'lib/chef-dk/generator.rb', line 37
def self.add_attr_to_context(name, value=nil)
sym_name = name.to_sym
ChefDK::Generator::Context.add_attr(sym_name)
ChefDK::Generator::TemplateHelper.delegate_to_app_context(sym_name)
context.public_send("#{sym_name}=", value)
end
|
.context ⇒ Object
33
34
35
|
# File 'lib/chef-dk/generator.rb', line 33
def self.context
@context ||= Context.new
end
|
.reset ⇒ Object
29
30
31
|
# File 'lib/chef-dk/generator.rb', line 29
def self.reset
@context = nil
end
|