Class: Revamp::Model::PuppetModule
- Inherits:
-
Object
- Object
- Revamp::Model::PuppetModule
- Defined in:
- lib/revamp/model/puppet-module.rb
Overview
This class describes a puppet module
Class Attribute Summary collapse
-
.attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Instance Attribute Summary collapse
-
#files ⇒ Object
Returns the value of attribute files.
-
#metadata ⇒ Object
Returns the value of attribute metadata.
-
#name ⇒ Object
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
- #add_file(path, content) ⇒ Object
- #attributes ⇒ Object
- #dependencies=(deps) ⇒ Object
-
#initialize ⇒ PuppetModule
constructor
A new instance of PuppetModule.
- #rawname ⇒ Object
- #slugname ⇒ Object
Constructor Details
#initialize ⇒ PuppetModule
Returns a new instance of PuppetModule.
51 52 53 54 55 |
# File 'lib/revamp/model/puppet-module.rb', line 51 def initialize @files = {} @metadata = nil @dependencies = [] end |
Class Attribute Details
.attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
36 37 38 |
# File 'lib/revamp/model/puppet-module.rb', line 36 def attributes @attributes end |
Instance Attribute Details
#files ⇒ Object
Returns the value of attribute files.
39 40 41 |
# File 'lib/revamp/model/puppet-module.rb', line 39 def files @files end |
#metadata ⇒ Object
Returns the value of attribute metadata.
40 41 42 |
# File 'lib/revamp/model/puppet-module.rb', line 40 def @metadata end |
#name ⇒ Object
Returns the value of attribute name.
41 42 43 |
# File 'lib/revamp/model/puppet-module.rb', line 41 def name @name end |
Class Method Details
.puppet_accessor(*vars) ⇒ Object
29 30 31 32 33 |
# File 'lib/revamp/model/puppet-module.rb', line 29 def self.puppet_accessor(*vars) @attributes ||= [] @attributes.concat vars attr_accessor(*vars) end |
Instance Method Details
#add_file(path, content) ⇒ Object
57 58 59 |
# File 'lib/revamp/model/puppet-module.rb', line 57 def add_file(path, content) @files[path] = content end |
#attributes ⇒ Object
61 62 63 |
# File 'lib/revamp/model/puppet-module.rb', line 61 def attributes self.class.attributes end |
#dependencies=(deps) ⇒ Object
65 66 67 68 69 70 |
# File 'lib/revamp/model/puppet-module.rb', line 65 def dependencies=(deps) @dependencies = [] deps.each do |dep| @dependencies << Revamp::Model::PuppetDependency.new(dep) end end |
#rawname ⇒ Object
76 77 78 |
# File 'lib/revamp/model/puppet-module.rb', line 76 def rawname name.split('/')[-1] end |
#slugname ⇒ Object
72 73 74 |
# File 'lib/revamp/model/puppet-module.rb', line 72 def slugname Revamp::Mapper::PuppetNameSlugger.new.map(name) end |