Updated mcollective.init according to OSCI-658
[packages/precise/mcollective.git] / lib / mcollective / aggregate / result / base.rb
diff --git a/lib/mcollective/aggregate/result/base.rb b/lib/mcollective/aggregate/result/base.rb
new file mode 100644 (file)
index 0000000..a04427b
--- /dev/null
@@ -0,0 +1,25 @@
+module MCollective
+  class Aggregate
+    module Result
+      class Base
+        attr_accessor :result, :aggregate_format, :action
+
+        def initialize(result, aggregate_format, action)
+          raise "No aggregate_format defined in ddl or aggregate function" unless aggregate_format
+
+          @result = result
+          @aggregate_format = aggregate_format
+          @action = action
+        end
+
+        def to_s
+          raise "'to_s' method not implemented for result class '#{self.class}'"
+        end
+
+        def result_type
+          @result[:type]
+        end
+      end
+    end
+  end
+end