From a972e0645b31cf1eb89874cb08b403bdc0fad3a4 Mon Sep 17 00:00:00 2001 From: Sharif Nassar Date: Wed, 5 Feb 2014 15:01:45 -0800 Subject: Remove trailing whitespace --- lib/puppet/parser/functions/delete_undef_values.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/puppet/parser/functions/delete_undef_values.rb') diff --git a/lib/puppet/parser/functions/delete_undef_values.rb b/lib/puppet/parser/functions/delete_undef_values.rb index 532639e..f94d4da 100644 --- a/lib/puppet/parser/functions/delete_undef_values.rb +++ b/lib/puppet/parser/functions/delete_undef_values.rb @@ -3,7 +3,7 @@ module Puppet::Parser::Functions Returns a copy of input hash or array with all undefs deleted. *Examples:* - + $hash = delete_undef_values({a=>'A', b=>'', c=>undef, d => false}) Would return: {a => 'A', b => '', d => false} @@ -11,19 +11,19 @@ Would return: {a => 'A', b => '', d => false} $array = delete_undef_values(['A','',undef,false]) Would return: ['A','',false] - + EOS ) do |args| raise(Puppet::ParseError, "delete_undef_values(): Wrong number of arguments given " + "(#{args.size})") if args.size < 1 - - unless args[0].is_a? Array or args[0].is_a? Hash + + unless args[0].is_a? Array or args[0].is_a? Hash raise(Puppet::ParseError, "delete_undef_values(): expected an array or hash, got #{args[0]} type #{args[0].class} ") end - result = args[0].dup + result = args[0].dup if result.is_a?(Hash) result.delete_if {|key, val| val.equal? :undef} elsif result.is_a?(Array) -- cgit v1.2.3