Class: PuppetModule::Pkg::Tasks::Modulefile
- Inherits:
-
Object
- Object
- PuppetModule::Pkg::Tasks::Modulefile
- Defined in:
- lib/puppet_module/pkg/tasks/modulefile.rb
Instance Attribute Summary collapse
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(str) ⇒ Modulefile
constructor
A new instance of Modulefile.
- #method_missing(*args) ⇒ Object
Constructor Details
#initialize(str) ⇒ Modulefile
Returns a new instance of Modulefile.
13 14 15 16 17 18 |
# File 'lib/puppet_module/pkg/tasks/modulefile.rb', line 13 def initialize(str) @metadata = OpenStruct.new @metadata.dependencies = [] binding.eval str validate_required_fields end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(*args) ⇒ Object
20 21 22 23 24 |
# File 'lib/puppet_module/pkg/tasks/modulefile.rb', line 20 def method_missing(*args) # TODO: Maybe display an info message about the # unrecognized/unsupported field? (it might be a typo, so the user # might be happy to know what have been ignored) end |
Instance Attribute Details
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
11 12 13 |
# File 'lib/puppet_module/pkg/tasks/modulefile.rb', line 11 def @metadata end |
Class Method Details
.parse(file) ⇒ Object
7 8 9 |
# File 'lib/puppet_module/pkg/tasks/modulefile.rb', line 7 def self.parse(file) self.new(File.read(file)). end |