1 # Boolean check to determine whether a variable is of a given data type. This is equivalent to the `=~` type checks.
3 # @example how to check a data type
9 # if $foo.is_a(Integer) {
12 # if $bar.is_a(Array) {
15 # if $baz.is_a(String) {
19 # See the documentation for "The Puppet Type System" for more information about types.
20 # See the `assert_type()` function for flexible ways to assert the type of a value.
22 Puppet::Functions.create_function(:is_a) do
29 # See puppet's lib/puppet/pops/evaluator/evaluator_impl.rb eval_MatchExpression
30 Puppet::Pops::Types::TypeCalculator.instance?(type, value)