From 2ba5404b16911c6a926e66a5efbe0b164cb6b658 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Tomulik?= Date: Thu, 8 Aug 2013 16:56:32 +0200 Subject: minor corrections to delete_values() --- lib/puppet/parser/functions/delete_values.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/puppet/parser/functions/delete_values.rb b/lib/puppet/parser/functions/delete_values.rb index 2fcbd16..17b9d37 100644 --- a/lib/puppet/parser/functions/delete_values.rb +++ b/lib/puppet/parser/functions/delete_values.rb @@ -15,12 +15,11 @@ Would return: {'a'=>'A','c'=>'C','B'=>'D'} "delete_values(): Wrong number of arguments given " + "(#{arguments.size} of 2)") if arguments.size != 2 - hash = arguments[0] - item = arguments[1] + hash, item = arguments if not hash.is_a?(Hash) raise(TypeError, "delete_values(): First argument must be a Hash. " + \ - "Given an" " argument of class #{hash.class}.") + "Given an argument of class #{hash.class}.") end hash.delete_if { |key, val| item == val } end -- cgit v1.2.3