a04427ba05db6733facac5ec092b1a86bdd74183
[packages/precise/mcollective.git] / lib / mcollective / aggregate / result / base.rb
1 module MCollective
2   class Aggregate
3     module Result
4       class Base
5         attr_accessor :result, :aggregate_format, :action
6
7         def initialize(result, aggregate_format, action)
8           raise "No aggregate_format defined in ddl or aggregate function" unless aggregate_format
9
10           @result = result
11           @aggregate_format = aggregate_format
12           @action = action
13         end
14
15         def to_s
16           raise "'to_s' method not implemented for result class '#{self.class}'"
17         end
18
19         def result_type
20           @result[:type]
21         end
22       end
23     end
24   end
25 end