1ee01fc86e9cf22dbf1f095de5bcfe943982be51
[packages/precise/mcollective.git] / lib / mcollective / aggregate / result / collection_result.rb
1 module MCollective
2   class Aggregate
3     module Result
4       class CollectionResult<Base
5         def to_s
6           return "" if @result[:value].keys.include?(nil)
7
8           result = StringIO.new
9
10           @result[:value].sort{|x,y| x[1] <=> y[1]}.reverse.each do |value|
11             result.puts @aggregate_format % [value[0], value[1]]
12           end
13
14           result.string.chomp
15         end
16       end
17     end
18   end
19 end