Class: Chef::Environment

Inherits:
Object show all
Defined in:
lib/chef/knife/chop/chef_environment.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#loggerObject (readonly)

Returns the value of attribute logger.



29
30
31
# File 'lib/chef/knife/chop/chef_environment.rb', line 29

def logger
  @logger
end

Instance Method Details

#generate_json(part) ⇒ Object




32
33
34
# File 'lib/chef/knife/chop/chef_environment.rb', line 32

def generate_json(part)
  self.to_json
end

#generate_rb(part) ⇒ Object




37
38
39
40
41
42
43
44
45
# File 'lib/chef/knife/chop/chef_environment.rb', line 37

def generate_rb(part)
  src = []
  src << "name '#{@name}'"
  src << "description '#{@description}'"
  src << part.hash_to_rb('cookbook_versions')
  src << part.hash_to_rb('default_attributes')
  src << part.hash_to_rb('override_attributes')
  src.join("\n")
end