X-Git-Url: https://git.adam-barratt.org.uk/?p=mirror%2Fdsa-puppet.git;a=blobdiff_plain;f=3rdparty%2Fmodules%2Fstdlib%2Flib%2Fpuppet%2Ffunctions%2Fis_a.rb;h=0302df92d640dbda2bc9953392a95135e754727f;hp=24b97441c43916c5b0f0fe6d2e8c998f436fcf42;hb=30caaa85aed7015ca0d77216bff175eebd917eb7;hpb=6f656bd4265e3dab13b9af2bf96e9044322e9d8f diff --git a/3rdparty/modules/stdlib/lib/puppet/functions/is_a.rb b/3rdparty/modules/stdlib/lib/puppet/functions/is_a.rb index 24b97441c..0302df92d 100644 --- a/3rdparty/modules/stdlib/lib/puppet/functions/is_a.rb +++ b/3rdparty/modules/stdlib/lib/puppet/functions/is_a.rb @@ -1,25 +1,35 @@ -# 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 how to check a data type +# @example Example Usage: # # check a data type -# foo = 3 -# $bar = [1,2,3] -# $baz = 'A string!' +# foo = 3 +# $bar = [1,2,3] +# $baz = 'A string!' # -# if $foo.is_a(Integer) { -# notify { 'foo!': } -# } -# if $bar.is_a(Array) { -# notify { 'bar!': } -# } -# if $baz.is_a(String) { -# notify { 'baz!': } -# } +# if $foo.is_a(Integer) { +# notify { 'foo!': } +# } +# if $bar.is_a(Array) { +# notify { 'bar!': } +# } +# if $baz.is_a(String) { +# notify { 'baz!': } +# } # # See the documentation for "The Puppet Type System" for more information about types. # See the `assert_type()` function for flexible ways to assert the type of a value. # 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_a do param 'Any', :value param 'Type', :type