Parent

Included Modules

Class/Module Index [+]

Quicksearch

MCollective::RPC::Result

Simple class to manage compliant results from MCollective::RPC agents

Currently it just fakes Hash behaviour to the result to remain backward compatible but it also knows which agent and action produced it so you can associate results to a DDL

Attributes

action[R]
agent[R]
results[R]

Public Instance Methods

[](idx) click to toggle source
# File lib/mcollective/rpc/result.rb, line 19
def [](idx)
  @results[idx]
end
[]=(idx, item) click to toggle source
# File lib/mcollective/rpc/result.rb, line 23
def []=(idx, item)
  @results[idx] = item
end
each() click to toggle source
# File lib/mcollective/rpc/result.rb, line 27
def each
  @results.each_pair {|k,v| yield(k,v) }
end
to_json(*a) click to toggle source
# File lib/mcollective/rpc/result.rb, line 31
def to_json(*a)
  {:agent => @agent,
   :action => @action,
   :sender => @results[:sender],
   :statuscode => @results[:statuscode],
   :statusmsg => @results[:statusmsg],
   :data => @results[:data]}.to_json(*a)
end

Public Class Methods

new(agent, action, result={}) click to toggle source
# File lib/mcollective/rpc/result.rb, line 13
def initialize(agent, action, result={})
  @agent = agent
  @action = action
  @results = result
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.