Update stdlib and concat to 6.1.0 both
[mirror/dsa-puppet.git] / 3rdparty / modules / stdlib / lib / puppet / parser / functions / is_hash.rb
1 #
2 # is_hash.rb
3 #
4 module Puppet::Parser::Functions
5   newfunction(:is_hash, :type => :rvalue, :doc => <<-DOC
6     @summary
7       **Deprecated:** Returns true if the variable passed to this function is a hash.
8
9     @return [Boolean]
10       Returns `true` or `false`
11
12     > **Note:* **Deprecated** Will be removed in a future version of stdlib. See
13     [`validate_legacy`](#validate_legacy).
14     DOC
15              ) do |arguments|
16
17     raise(Puppet::ParseError, "is_hash(): Wrong number of arguments given (#{arguments.size} for 1)") if arguments.size != 1
18
19     type = arguments[0]
20
21     result = type.is_a?(Hash)
22
23     return result
24   end
25 end
26
27 # vim: set ts=2 sw=2 et :