Method: Puppet::Functions::DispatcherBuilder#optional_block_param
- Defined in:
- lib/puppet/functions.rb
#optional_block_param(*type_and_name) ⇒ Object
Defines one optional block parameter that may appear last. If type or name is missing the defaults are “any callable”, and the name is “block”. The implementor of the dispatch target must use block = nil when it is optional (or an error is raised when the call is made).
513 514 515 516 517 |
# File 'lib/puppet/functions.rb', line 513 def optional_block_param(*type_and_name) # same as required, only wrap the result in an optional type required_block_param(*type_and_name) @block_type = Puppet::Pops::Types::TypeFactory.optional(@block_type) end |