Update stdlib and concat to 6.1.0 both
[mirror/dsa-puppet.git] / 3rdparty / modules / stdlib / lib / puppet / functions / is_a.rb
index 24b9744..0302df9 100644 (file)
@@ -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