Method: Puppet::Parameter.munge
- Defined in:
- lib/puppet/parameter.rb
.munge({|| ... }) ⇒ Object
Note:
This adds a method with the name ‘unsafe_munge` in the created parameter class. Later this method is called in a context where exceptions will be rescued and handled.
Defines an optional method used to convert the parameter value from DSL/string form to an internal form. If a munge method is not defined, the DSL/string value is used as is.
171 172 173 174 175 176 177 |
# File 'lib/puppet/parameter.rb', line 171 def munge(&block) # I need to wrap the unsafe version in begin/rescue parameterments, # but if I directly call the block then it gets bound to the # class's context, not the instance's, thus the two methods, # instead of just one. define_method(:unsafe_munge, &block) end |