puppetlabs-stdlib/lib/puppet/parser/functions/delete.rb

28 lines
559 B
Ruby
Raw Normal View History

#
# delete.rb
#
# TODO(Krzysztof Wilczynski): We need to add support for regular expression ...
# TODO(Krzysztof Wilczynski): Support for strings and hashes too ...
module Puppet::Parser::Functions
newfunction(:delete, :type => :rvalue, :doc => <<-EOS
EOS
) do |arguments|
if (arguments.size != 2) then
raise(Puppet::ParseError, "is_valid_netmask(): Wrong number of arguments "+
"given #{arguments.size} for 2")
end
2011-06-30 00:37:37 +02:00
a = arguments[0]
item = arguments[1]
a.delete(item)
a
end
end
# vim: set ts=2 sw=2 et :