>> pp h.sort{ |a,b|
>>   res = a[1][:a] <=> b[1][:a]
>>   if res == 0
>>     res = a[1][:b] <=> b[1][:b]
>>   end
>>   if res == 0
>>     res = a[1][:c] <=> b[1][:c]
>>   end
>>   if res == 0
>>     res = a[1][:d] <=> b[1][:d]
>>   end
>>   res
>> }.reverse
>
> Checkout Numeric#nonzero?.


.... learning a new thing everyday... thanks.

Patrick