Sha256: 27dbcca7db9b08864374d487b6a6a31377fd58d61887d9131a90b16480ec8fac

Contents?: true

Size: 730 Bytes

Versions: 164

Compression:

Stored size: 730 Bytes

Contents

# (Documentation in 3.x stub)
# @since 4.4.0
#
Puppet::Functions.create_function(:type) do
  dispatch :type_detailed do
    param 'Any', :value
    optional_param 'Enum[detailed]', :inference_method
  end

  dispatch :type_parameterized do
    param 'Any', :value
    param 'Enum[reduced]', :inference_method
  end

  dispatch :type_generalized do
    param 'Any', :value
    param 'Enum[generalized]', :inference_method
  end

  def type_detailed(value, _ = nil)
    Puppet::Pops::Types::TypeCalculator.infer_set(value)
  end

  def type_parameterized(value, _)
    Puppet::Pops::Types::TypeCalculator.infer(value)
  end

  def type_generalized(value, _)
    Puppet::Pops::Types::TypeCalculator.infer(value).generalize
  end
end

Version data entries

164 entries across 164 versions & 3 rubygems

Version Path
bolt-0.16.0 vendored/puppet/lib/puppet/functions/type.rb
bolt-0.15.0 vendored/puppet/lib/puppet/functions/type.rb
bolt-0.14.0 vendored/puppet/lib/puppet/functions/type.rb
bolt-0.13.0 vendored/puppet/lib/puppet/functions/type.rb
puppet-retrospec-1.6.1 vendor/pup410/lib/puppet/functions/type.rb
bolt-0.12.0 vendored/puppet/lib/puppet/functions/type.rb
bolt-0.11.0 vendored/puppet/lib/puppet/functions/type.rb
bolt-0.10.0 vendored/puppet/lib/puppet/functions/type.rb
puppet-retrospec-1.6.0 vendor/pup410/lib/puppet/functions/type.rb
bolt-0.9.0 vendored/puppet/lib/puppet/functions/type.rb
bolt-0.8.0 vendored/puppet/lib/puppet/functions/type.rb
puppet-4.10.9 lib/puppet/functions/type.rb
puppet-4.10.9-x86-mingw32 lib/puppet/functions/type.rb
puppet-4.10.9-x64-mingw32 lib/puppet/functions/type.rb
puppet-4.10.9-universal-darwin lib/puppet/functions/type.rb
puppet-5.3.3 lib/puppet/functions/type.rb
puppet-5.3.3-x86-mingw32 lib/puppet/functions/type.rb
puppet-5.3.3-x64-mingw32 lib/puppet/functions/type.rb
puppet-5.3.3-universal-darwin lib/puppet/functions/type.rb
bolt-0.7.0 vendored/puppet/lib/puppet/functions/type.rb