### Home Classes Methods

### In Files

- lib/mcollective/aggregate/base.rb

### Parent

Object

### Methods

- ::new
- #result_class
- #summarize

### Files

- COPYING
- README
- Rakefile
- PLACEHOLDER
- PLACEHOLDER

### Class/Module Index

Quicksearch

- MCollective
- MCollective::Agent
- MCollective::Agents
- MCollective::Aggregate
- MCollective::Aggregate::Base
- MCollective::Aggregate::Result
- MCollective::Aggregate::Result::Base
- MCollective::Aggregate::Result::CollectionResult
- MCollective::Aggregate::Result::NumericResult
- MCollective::Application
- MCollective::Applications
- MCollective::Client
- MCollective::Config
- MCollective::Connector
- MCollective::Connector::Base
- MCollective::DDL
- MCollective::DDLValidationError
- MCollective::Data
- MCollective::Data::Base
- MCollective::Data::Result
- MCollective::Discovery
- MCollective::Facts
- MCollective::Facts::Base
- MCollective::Generators
- MCollective::Generators::AgentGenerator
- MCollective::Generators::Base
- MCollective::Generators::DataGenerator
- MCollective::InvalidRPCData
- MCollective::Log
- MCollective::Logger
- MCollective::Logger::Base
- MCollective::Logger::Console_logger
- MCollective::Logger::File_logger
- MCollective::Logger::Syslog_logger
- MCollective::Matcher
- MCollective::Matcher::Parser
- MCollective::Matcher::Scanner
- MCollective::Message
- MCollective::MissingRPCData
- MCollective::MsgDoesNotMatchRequestID
- MCollective::MsgTTLExpired
- MCollective::NotTargettedAtUs
- MCollective::Optionparser
- MCollective::PluginManager
- MCollective::PluginPackager
- MCollective::PluginPackager::AgentDefinition
- MCollective::PluginPackager::StandardDefinition
- MCollective::RPC
- MCollective::RPC::ActionRunner
- MCollective::RPC::Agent
- MCollective::RPC::Audit
- MCollective::RPC::Client
- MCollective::RPC::Helpers
- MCollective::RPC::Progress
- MCollective::RPC::Reply
- MCollective::RPC::Request
- MCollective::RPC::Result
- MCollective::RPC::Stats
- MCollective::RPCAborted
- MCollective::RPCError
- MCollective::Registration
- MCollective::Registration::Base
- MCollective::Runner
- MCollective::RunnerStats
- MCollective::SSL
- MCollective::Security
- MCollective::Security::Base
- MCollective::SecurityValidationFailed
- MCollective::Shell
- MCollective::UnixDaemon
- MCollective::UnknownRPCAction
- MCollective::UnknownRPCError
- MCollective::Util
- MCollective::WindowsDaemon
- Array
- Dir
- Object
- String
- Symbol

No matching classes.

# MCollective::Aggregate::Base

### Attributes

action[RW]
aggregate_format[RW]
arguments[RW]
name[RW]
output_name[RW]
result[RW]

### Public Instance Methods

result_class(type) click to toggle source

    # File lib/mcollective/aggregate/base.rb, line 35
    def result_class(type)
      Result.const_get("#{type.to_s.capitalize}Result")
    end

summarize() click to toggle source

Stops execution of the function and returns a specific ResultObject, aggregate functions will most likely override this but this is the simplest case so we might as well default to that

    # File lib/mcollective/aggregate/base.rb, line 29
    def summarize
      raise "Result type is not set while trying to summarize aggregate function results" unless @result[:type]

      result_class(@result[:type]).new(@result, @aggregate_format, @action)
    end

### Public Class Methods

new(output_name, arguments, aggregate_format, action) click to toggle source

    # File lib/mcollective/aggregate/base.rb, line 6
    def initialize(output_name, arguments, aggregate_format, action)
      @name = self.class.to_s
      @output_name = output_name

      # Any additional arguments passed in the ddl after the output field will
      # be stored in the arguments array which can be used in the function
      @arguments = arguments
      @aggregate_format = aggregate_format
      @action = action
      @result = {:value => nil, :type => nil, :output => output_name}

      startup_hook
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.