Class: PuppetGenerator::PuppetObjects::File
- Inherits:
-
Object
- Object
- PuppetGenerator::PuppetObjects::File
- Includes:
- PuppetGenerator::PuppetHelper
- Defined in:
- lib/puppet_generator/puppet_objects/file.rb
Instance Attribute Summary collapse
-
#class_name ⇒ Object
readonly
Returns the value of attribute class_name.
-
#mode ⇒ Object
readonly
Returns the value of attribute mode.
-
#module_name ⇒ Object
readonly
Returns the value of attribute module_name.
-
#owner ⇒ Object
readonly
Returns the value of attribute owner.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(entry, module_name, class_name) ⇒ File
constructor
A new instance of File.
- #name ⇒ Object
- #suggested_file_name ⇒ Object
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) ⇒ File
Returns a new instance of File.
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/puppet_generator/puppet_objects/file.rb', line 9 def initialize(entry, module_name, class_name) @path = entry[:name] @module_name = module_name @class_name = class_name @owner = entry[:owner] @mode = entry[:mode] @type = entry.fetch( :type, 'file' ) @source = entry[:source] end |
Instance Attribute Details
#class_name ⇒ Object (readonly)
Returns the value of attribute class_name.
7 8 9 |
# File 'lib/puppet_generator/puppet_objects/file.rb', line 7 def class_name @class_name end |
#mode ⇒ Object (readonly)
Returns the value of attribute mode.
7 8 9 |
# File 'lib/puppet_generator/puppet_objects/file.rb', line 7 def mode @mode end |
#module_name ⇒ Object (readonly)
Returns the value of attribute module_name.
7 8 9 |
# File 'lib/puppet_generator/puppet_objects/file.rb', line 7 def module_name @module_name end |
#owner ⇒ Object (readonly)
Returns the value of attribute owner.
7 8 9 |
# File 'lib/puppet_generator/puppet_objects/file.rb', line 7 def owner @owner end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
7 8 9 |
# File 'lib/puppet_generator/puppet_objects/file.rb', line 7 def path @path end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
7 8 9 |
# File 'lib/puppet_generator/puppet_objects/file.rb', line 7 def source @source end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
7 8 9 |
# File 'lib/puppet_generator/puppet_objects/file.rb', line 7 def type @type end |
Instance Method Details
#name ⇒ Object
20 21 22 |
# File 'lib/puppet_generator/puppet_objects/file.rb', line 20 def name ::File.basename(path) end |
#suggested_file_name ⇒ Object
24 25 26 |
# File 'lib/puppet_generator/puppet_objects/file.rb', line 24 def suggested_file_name puppet_manifest_path( name ) end |