Class: Chef::Role

Inherits:
Object show all
Defined in:
lib/chef/knife/chop/chef_role.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_role.rb', line 29

def logger
  @logger
end

Instance Method Details

#generate_json(part) ⇒ Object




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

def generate_json(part)
  self.to_json
end

#generate_rb(part) ⇒ Object




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

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