Class | MCollective::RPC::Result |
In: |
lib/mcollective/rpc/result.rb
|
Parent: | Object |
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
action | [R] | |
agent | [R] | |
results | [R] |
# File lib/mcollective/rpc/result.rb, line 13 13: def initialize(agent, action, result={}) 14: @agent = agent 15: @action = action 16: @results = result 17: end
# File lib/mcollective/rpc/result.rb, line 23 23: def []=(idx, item) 24: @results[idx] = item 25: end
# File lib/mcollective/rpc/result.rb, line 31 31: def each 32: @results.each_pair {|k,v| yield(k,v) } 33: end
# File lib/mcollective/rpc/result.rb, line 27 27: def fetch(key, default) 28: @results.fetch(key, default) 29: end