Added function that checks if given value is array.
This commit is contained in:
parent
79c74e6152
commit
0b5f9681fa
1 changed files with 8 additions and 0 deletions
8
util/lib/puppet/parser/functions/is_array.rb
Normal file
8
util/lib/puppet/parser/functions/is_array.rb
Normal file
|
@ -0,0 +1,8 @@
|
|||
module Puppet::Parser::Functions
|
||||
newfunction(:is_array, :type => :rvalue) do |args|
|
||||
if args.length != 1
|
||||
raise Puppet::ParseError, ("is_array(): wrong number of arguments (#{args.length}; must be 2)")
|
||||
end
|
||||
args[0].is_a?(Array)
|
||||
end
|
||||
end
|
Loading…
Add table
Reference in a new issue