lib/puppet/functions.rb
def create_callable(types, block_type, return_type, from, to)
      mapped_types = types.map do |t|
        Puppet::Pops::Types::TypeParser.singleton.parse(t, loader)
      end
      param_types = Puppet::Pops::Types::PTupleType.new(mapped_types, from > 0 && from == to ? nil : Puppet::Pops::Types::PIntegerType.new(from, to))
      return_type = Puppet::Pops::Types::TypeParser.singleton.parse(return_type, loader) unless return_type.nil?
      Puppet::Pops::Types::PCallableType.new(param_types, block_type, return_type)
    end
# Handles creation of a callable type from strings specifications of puppet
# types and allows the min/max occurs of the given types to be given as one
# or two integer values at the end.  The given block_type should be
# Optional[Callable], Callable, or nil.
#
# @api private
Handles creation of a callable type from strings specifications of puppet
types and allows the min/max occurs of the given types to be given as one
or two integer values at the end.  The given block_type should be
Optional[Callable], Callable, or nil.
Handles creation of a callable type from strings specifications of puppet types and allows the min / max occurs of the given types to be given as one or two integer values at the end . The given block_type should be Optional [ Callable ] Callable or nil .
def create_callable(types, block_type, return_type, from, to)
      mapped_types = types.map do |t|
        Puppet::Pops::Types::TypeParser.singleton.parse(t, loader)
      end
      param_types = Puppet::Pops::Types::PTupleType.new(mapped_types, from > 0 && from == to ? nil : Puppet::Pops::Types::PIntegerType.new(from, to))
      return_type = Puppet::Pops::Types::TypeParser.singleton.parse(return_type, loader) unless return_type.nil?
      Puppet::Pops::Types::PCallableType.new(param_types, block_type, return_type)
    end
def create_callable ( types , block_type , return_type , from , to ) mapped_types = types . map do | t | Puppet :: Pops :: Types :: TypeParser . singleton . parse ( t , loader ) end param_types = Puppet :: Pops :: Types :: PTupleType . new ( mapped_types , from > 0 && from == to ? nil : Puppet :: Pops :: Types :: PIntegerType . new ( from , to ) ) return_type = Puppet :: Pops :: Types :: TypeParser . singleton . parse ( return_type , loader ) unless return_type . nil? Puppet :: Pops :: Types :: PCallableType . new ( param_types , block_type , return_type ) end
Handles creation of a callable type from strings specifications of puppet
types and allows the min/max occurs of the given types to be given as one
or two integer values at the end.
Handles creation of a callable type from strings specifications of puppet types and allows the min / max occurs of the given types to be given as one or two integer values at the end .
types
block_type
return_type
from
to
api
None