# Boolean check to determine whether a variable is of a given data type. This is equivalent to the `=~` type checks.
# @summary
# Boolean check to determine whether a variable is of a given data type.
# This is equivalent to the `=~` type checks.
#
#
# @example Example Usage:
# @example how to check a data type
# # check a data type
# # check a data type
# foo = 3
# foo = 3
# $bar = [1,2,3]
# $bar = [1,2,3]
...
@@ -24,20 +20,12 @@
...
@@ -24,20 +20,12 @@
# See the `assert_type()` function for flexible ways to assert the type of a value.
# See the `assert_type()` function for flexible ways to assert the type of a value.
#
#
Puppet::Functions.create_function(:is_a)do
Puppet::Functions.create_function(:is_a)do
# @param value
# The value to be checked
#
# @param type
# The expected type
#
# @return [Boolean]
# Return's `true` or `false`.
dispatch:is_ado
dispatch:is_ado
param'Any',:value
param'Any',:value
param'Type',:type
param'Type',:type
end
end
defis_a(value,type)# rubocop:disable Naming/PredicateName : Used in to many other places to rename at this time, attempting to refactor caused Rubocop to crash.
defis_a(value,type)# rubocop:disable Style/PredicateName : Used in to many other places to rename at this time, attempting to refactor caused Rubocop to crash.
# See puppet's lib/puppet/pops/evaluator/evaluator_impl.rb eval_MatchExpression
# See puppet's lib/puppet/pops/evaluator/evaluator_impl.rb eval_MatchExpression