5 module Puppet::Parser::Functions
6 newfunction(:any2array, :type => :rvalue, :doc => <<-EOS
7 This converts any object to an array containing that object. Empty argument
8 lists are converted to an empty array. Arrays are left untouched. Hashes are
9 converted to arrays of alternating keys and values.
17 if arguments.length == 1
18 if arguments[0].kind_of?(Array)
20 elsif arguments[0].kind_of?(Hash)
22 arguments[0].each do |key, value|
23 result << key << value
33 # vim: set ts=2 sw=2 et :