Suggest different variables to use if we want to tunnel both v4 and v6
[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     Returns true if the variable passed to this function is a hash.
7     DOC
8              ) do |arguments|
9
10     raise(Puppet::ParseError, "is_hash(): Wrong number of arguments given (#{arguments.size} for 1)") if arguments.size != 1
11
12     type = arguments[0]
13
14     result = type.is_a?(Hash)
15
16     return result
17   end
18 end
19
20 # vim: set ts=2 sw=2 et :