puppetlabs-stdlib/lib/puppet/functions
David Schmitt 00c881d0da (MODULES-2516) Adds an is_a() function
The data type system is very hard to understand. Many people don't
understand why

    type_of([1,2,3]) == Array

will fail, but

    type_of([1,2,3]) <= Array

passes. This does a simpler validation that doesn't rely on explicit
data types. Instead, use

    $foo = [1,2,3]
    if $foo.is_a(Array) {
      notify { 'This is an array': }
    }

This is based on code by Ben Ford <ben.ford@puppetlabs.com>.

  * Added acceptance tests
  * Added dispatch
  * Improved unit tests
  * Added docs to README
2015-09-14 18:26:25 +01:00
..
is_a.rb (MODULES-2516) Adds an is_a() function 2015-09-14 18:26:25 +01:00
type_of.rb (MODULES-1473) Deprecate type() function for new parser 2015-01-07 16:40:06 -08:00