]> git.donarmstrong.com Git - dsa-puppet.git/blob - 3rdparty/modules/concat/lib/puppet/parser/functions/concat_is_bool.rb
try if downgrading to 1.2.2 solves my problem
[dsa-puppet.git] / 3rdparty / modules / concat / lib / puppet / parser / functions / concat_is_bool.rb
1 #
2 # concat_is_bool.rb
3 #
4
5 module Puppet::Parser::Functions
6   newfunction(:concat_is_bool, :type => :rvalue, :doc => <<-EOS
7 Returns true if the variable passed to this function is a boolean.
8     EOS
9   ) do |arguments|
10
11     raise(Puppet::ParseError, "concat_is_bool(): Wrong number of arguments " +
12       "given (#{arguments.size} for 1)") if arguments.size != 1
13
14     type = arguments[0]
15
16     result = type.is_a?(TrueClass) || type.is_a?(FalseClass)
17
18     return result
19   end
20 end
21
22 # vim: set ts=2 sw=2 et :