Class: PuppetGenerator::PuppetObjects::Role

Inherits:
Object
  • Object
show all
Includes:
PuppetGenerator::PuppetHelper
Defined in:
lib/puppet_generator/puppet_objects/role.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from PuppetGenerator::PuppetHelper

#puppet_class_name, #puppet_manifest_path, #puppet_module_name, #puppet_module_path

Constructor Details

#initialize(entry, module_name, class_name) ⇒ Role

Returns a new instance of Role.



9
10
11
12
13
14
15
# File 'lib/puppet_generator/puppet_objects/role.rb', line 9

def initialize(entry, module_name, class_name)
  @path = entry[:name]
  @module_name = entry.fetch(:module_name, module_name )
  @class_name = entry.fetch(:class_name, class_name )

  @includes = entry[:includes] || []
end

Instance Attribute Details

#class_nameObject (readonly)

Returns the value of attribute class_name.



7
8
9
# File 'lib/puppet_generator/puppet_objects/role.rb', line 7

def class_name
  @class_name
end

#includesObject (readonly)

Returns the value of attribute includes.



7
8
9
# File 'lib/puppet_generator/puppet_objects/role.rb', line 7

def includes
  @includes
end

#module_nameObject (readonly)

Returns the value of attribute module_name.



7
8
9
# File 'lib/puppet_generator/puppet_objects/role.rb', line 7

def module_name
  @module_name
end

#nameObject (readonly)

Returns the value of attribute name.



7
8
9
# File 'lib/puppet_generator/puppet_objects/role.rb', line 7

def name
  @name
end

#pathObject (readonly)

Returns the value of attribute path.



7
8
9
# File 'lib/puppet_generator/puppet_objects/role.rb', line 7

def path
  @path
end

Instance Method Details

#suggested_file_nameObject



17
18
19
# File 'lib/puppet_generator/puppet_objects/role.rb', line 17

def suggested_file_name
  puppet_manifest_path( path )
end