3 # Simple class to manage compliant results from MCollective::RPC agents
5 # Currently it just fakes Hash behaviour to the result to remain backward
6 # compatible but it also knows which agent and action produced it so you
7 # can associate results to a DDL
9 attr_reader :agent, :action, :results
13 def initialize(agent, action, result={})
27 def fetch(key, default)
28 @results.fetch(key, default)
32 @results.each_pair {|k,v| yield(k,v) }
38 :sender => @results[:sender],
39 :statuscode => @results[:statuscode],
40 :statusmsg => @results[:statusmsg],
41 :data => @results[:data]}.to_json(*a)