Update version according to OSCI-883
[packages/precise/mcollective.git] / doc / MCollective / RPC / Result.html
1 <?xml version="1.0" encoding="utf-8"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5 <head>
6         <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
7
8         <title>Class: MCollective::RPC::Result</title>
9
10         <link rel="stylesheet" href="../../rdoc.css" type="text/css" media="screen" />
11
12         <script src="../../js/jquery.js" type="text/javascript"
13                 charset="utf-8"></script>
14         <script src="../../js/thickbox-compressed.js" type="text/javascript"
15                 charset="utf-8"></script>
16         <script src="../../js/quicksearch.js" type="text/javascript"
17                 charset="utf-8"></script>
18         <script src="../../js/darkfish.js" type="text/javascript"
19                 charset="utf-8"></script>
20
21 </head>
22 <body class="class">
23
24         <div id="metadata">
25                 <div id="file-metadata">
26                         <div id="file-list-section" class="section">
27                                 <h3 class="section-header">In Files</h3>
28                                 <div class="section-body">
29                                         <ul>
30                                         
31                                                 <li><a href="../../lib/mcollective/rpc/result_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
32                                                         class="thickbox" title="lib/mcollective/rpc/result.rb">lib/mcollective/rpc/result.rb</a></li>
33                                         
34                                         </ul>
35                                 </div>
36                         </div>
37
38                         
39                 </div>
40
41                 <div id="class-metadata">
42
43                         <!-- Parent Class -->
44                         
45                         <div id="parent-class-section" class="section">
46                                 <h3 class="section-header">Parent</h3>
47                                 
48                                 <p class="link"><a href="../../Object.html">Object</a></p>
49                                 
50                         </div>
51                         
52
53                         <!-- Namespace Contents -->
54                         
55
56                         <!-- Method Quickref -->
57                         
58                         <div id="method-list-section" class="section">
59                                 <h3 class="section-header">Methods</h3>
60                                 <ul class="link-list">
61                                         
62                                         <li><a href="#M000428">::new</a></li>
63                                         
64                                         <li><a href="#M000429">#[]</a></li>
65                                         
66                                         <li><a href="#M000430">#[]=</a></li>
67                                         
68                                         <li><a href="#M000432">#each</a></li>
69                                         
70                                         <li><a href="#M000431">#fetch</a></li>
71                                         
72                                         <li><a href="#M000433">#to_json</a></li>
73                                         
74                                 </ul>
75                         </div>
76                         
77
78                         <!-- Included Modules -->
79                         
80                         <div id="includes-section" class="section">
81                                 <h3 class="section-header">Included Modules</h3>
82                                 <ul class="link-list">
83                                 
84                                 
85                                         <li><span class="include">Enumerable</span></li>
86                                 
87                                 
88                                 </ul>
89                         </div>
90                         
91                 </div>
92
93                 <div id="project-metadata">
94                         
95                         
96                         <div id="fileindex-section" class="section project-section">
97                                 <h3 class="section-header">Files</h3>
98                                 <ul>
99                                 
100                                         <li class="file"><a href="../../COPYING.html">COPYING</a></li>
101                                 
102                                         <li class="file"><a href="../../Gemfile.html">Gemfile</a></li>
103                                 
104                                         <li class="file"><a href="../../README.html">README</a></li>
105                                 
106                                         <li class="file"><a href="../../Rakefile.html">Rakefile</a></li>
107                                 
108                                         <li class="file"><a href="../../etc/client_cfg_dist.html">client.cfg.dist</a></li>
109                                 
110                                         <li class="file"><a href="../../etc/data-help_erb.html">data-help.erb</a></li>
111                                 
112                                         <li class="file"><a href="../../etc/discovery-help_erb.html">discovery-help.erb</a></li>
113                                 
114                                         <li class="file"><a href="../../etc/facts_yaml_dist.html">facts.yaml.dist</a></li>
115                                 
116                                         <li class="file"><a href="../../etc/metadata-help_erb.html">metadata-help.erb</a></li>
117                                 
118                                         <li class="file"><a href="../../etc/msg-help_erb.html">msg-help.erb</a></li>
119                                 
120                                         <li class="file"><a href="../../etc/rpc-help_erb.html">rpc-help.erb</a></li>
121                                 
122                                         <li class="file"><a href="../../etc/server_cfg_dist.html">server.cfg.dist</a></li>
123                                 
124                                         <li class="file"><a href="../../etc/ssl/PLACEHOLDER.html">PLACEHOLDER</a></li>
125                                 
126                                         <li class="file"><a href="../../etc/ssl/clients/PLACEHOLDER.html">PLACEHOLDER</a></li>
127                                 
128                                         <li class="file"><a href="../../lib/mcollective/generators/templates/action_snippet_erb.html">action_snippet.erb</a></li>
129                                 
130                                         <li class="file"><a href="../../lib/mcollective/generators/templates/data_input_snippet_erb.html">data_input_snippet.erb</a></li>
131                                 
132                                         <li class="file"><a href="../../lib/mcollective/generators/templates/ddl_erb.html">ddl.erb</a></li>
133                                 
134                                         <li class="file"><a href="../../lib/mcollective/generators/templates/plugin_erb.html">plugin.erb</a></li>
135                                 
136                                         <li class="file"><a href="../../lib/mcollective/locales/en_yml.html">en.yml</a></li>
137                                 
138                                         <li class="file"><a href="../../mcollective_init.html">mcollective.init</a></li>
139                                 
140                                 </ul>
141                         </div>
142                         
143
144                         <div id="classindex-section" class="section project-section">
145                                 <h3 class="section-header">Class Index
146                                         <span class="search-toggle"><img src="../../images/find.png"
147                                                 height="16" width="16" alt="[+]"
148                                                 title="show/hide quicksearch" /></span></h3>
149                                 <form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
150                                 <fieldset>
151                                         <legend>Quicksearch</legend>
152                                         <input type="text" name="quicksearch" value=""
153                                                 class="quicksearch-field" />
154                                 </fieldset>
155                                 </form>
156
157                                 <ul class="link-list">
158                                 
159                                         <li><a href="../../MCollective.html">MCollective</a></li>
160                                 
161                                         <li><a href="../../MCollective/Agent.html">MCollective::Agent</a></li>
162                                 
163                                         <li><a href="../../MCollective/Agents.html">MCollective::Agents</a></li>
164                                 
165                                         <li><a href="../../MCollective/Aggregate.html">MCollective::Aggregate</a></li>
166                                 
167                                         <li><a href="../../MCollective/Aggregate/Base.html">MCollective::Aggregate::Base</a></li>
168                                 
169                                         <li><a href="../../MCollective/Aggregate/Result.html">MCollective::Aggregate::Result</a></li>
170                                 
171                                         <li><a href="../../MCollective/Aggregate/Result/Base.html">MCollective::Aggregate::Result::Base</a></li>
172                                 
173                                         <li><a href="../../MCollective/Aggregate/Result/CollectionResult.html">MCollective::Aggregate::Result::CollectionResult</a></li>
174                                 
175                                         <li><a href="../../MCollective/Aggregate/Result/NumericResult.html">MCollective::Aggregate::Result::NumericResult</a></li>
176                                 
177                                         <li><a href="../../MCollective/Application.html">MCollective::Application</a></li>
178                                 
179                                         <li><a href="../../MCollective/Applications.html">MCollective::Applications</a></li>
180                                 
181                                         <li><a href="../../MCollective/Cache.html">MCollective::Cache</a></li>
182                                 
183                                         <li><a href="../../MCollective/Client.html">MCollective::Client</a></li>
184                                 
185                                         <li><a href="../../MCollective/CodedError.html">MCollective::CodedError</a></li>
186                                 
187                                         <li><a href="../../MCollective/Config.html">MCollective::Config</a></li>
188                                 
189                                         <li><a href="../../MCollective/Connector.html">MCollective::Connector</a></li>
190                                 
191                                         <li><a href="../../MCollective/Connector/Base.html">MCollective::Connector::Base</a></li>
192                                 
193                                         <li><a href="../../MCollective/DDL.html">MCollective::DDL</a></li>
194                                 
195                                         <li><a href="../../MCollective/DDL/AgentDDL.html">MCollective::DDL::AgentDDL</a></li>
196                                 
197                                         <li><a href="../../MCollective/DDL/Base.html">MCollective::DDL::Base</a></li>
198                                 
199                                         <li><a href="../../MCollective/DDL/DataDDL.html">MCollective::DDL::DataDDL</a></li>
200                                 
201                                         <li><a href="../../MCollective/DDL/DiscoveryDDL.html">MCollective::DDL::DiscoveryDDL</a></li>
202                                 
203                                         <li><a href="../../MCollective/DDL/ValidatorDDL.html">MCollective::DDL::ValidatorDDL</a></li>
204                                 
205                                         <li><a href="../../MCollective/DDLValidationError.html">MCollective::DDLValidationError</a></li>
206                                 
207                                         <li><a href="../../MCollective/Data.html">MCollective::Data</a></li>
208                                 
209                                         <li><a href="../../MCollective/Data/Base.html">MCollective::Data::Base</a></li>
210                                 
211                                         <li><a href="../../MCollective/Data/Result.html">MCollective::Data::Result</a></li>
212                                 
213                                         <li><a href="../../MCollective/Discovery.html">MCollective::Discovery</a></li>
214                                 
215                                         <li><a href="../../MCollective/Facts.html">MCollective::Facts</a></li>
216                                 
217                                         <li><a href="../../MCollective/Facts/Base.html">MCollective::Facts::Base</a></li>
218                                 
219                                         <li><a href="../../MCollective/Generators.html">MCollective::Generators</a></li>
220                                 
221                                         <li><a href="../../MCollective/Generators/AgentGenerator.html">MCollective::Generators::AgentGenerator</a></li>
222                                 
223                                         <li><a href="../../MCollective/Generators/Base.html">MCollective::Generators::Base</a></li>
224                                 
225                                         <li><a href="../../MCollective/Generators/DataGenerator.html">MCollective::Generators::DataGenerator</a></li>
226                                 
227                                         <li><a href="../../MCollective/InvalidRPCData.html">MCollective::InvalidRPCData</a></li>
228                                 
229                                         <li><a href="../../MCollective/Log.html">MCollective::Log</a></li>
230                                 
231                                         <li><a href="../../MCollective/Logger.html">MCollective::Logger</a></li>
232                                 
233                                         <li><a href="../../MCollective/Logger/Base.html">MCollective::Logger::Base</a></li>
234                                 
235                                         <li><a href="../../MCollective/Logger/Console_logger.html">MCollective::Logger::Console_logger</a></li>
236                                 
237                                         <li><a href="../../MCollective/Logger/File_logger.html">MCollective::Logger::File_logger</a></li>
238                                 
239                                         <li><a href="../../MCollective/Logger/Syslog_logger.html">MCollective::Logger::Syslog_logger</a></li>
240                                 
241                                         <li><a href="../../MCollective/Matcher.html">MCollective::Matcher</a></li>
242                                 
243                                         <li><a href="../../MCollective/Matcher/Parser.html">MCollective::Matcher::Parser</a></li>
244                                 
245                                         <li><a href="../../MCollective/Matcher/Scanner.html">MCollective::Matcher::Scanner</a></li>
246                                 
247                                         <li><a href="../../MCollective/Message.html">MCollective::Message</a></li>
248                                 
249                                         <li><a href="../../MCollective/MissingRPCData.html">MCollective::MissingRPCData</a></li>
250                                 
251                                         <li><a href="../../MCollective/MsgDoesNotMatchRequestID.html">MCollective::MsgDoesNotMatchRequestID</a></li>
252                                 
253                                         <li><a href="../../MCollective/MsgTTLExpired.html">MCollective::MsgTTLExpired</a></li>
254                                 
255                                         <li><a href="../../MCollective/NotTargettedAtUs.html">MCollective::NotTargettedAtUs</a></li>
256                                 
257                                         <li><a href="../../MCollective/Optionparser.html">MCollective::Optionparser</a></li>
258                                 
259                                         <li><a href="../../MCollective/PluginManager.html">MCollective::PluginManager</a></li>
260                                 
261                                         <li><a href="../../MCollective/PluginPackager.html">MCollective::PluginPackager</a></li>
262                                 
263                                         <li><a href="../../MCollective/PluginPackager/AgentDefinition.html">MCollective::PluginPackager::AgentDefinition</a></li>
264                                 
265                                         <li><a href="../../MCollective/PluginPackager/StandardDefinition.html">MCollective::PluginPackager::StandardDefinition</a></li>
266                                 
267                                         <li><a href="../../MCollective/RPC.html">MCollective::RPC</a></li>
268                                 
269                                         <li><a href="../../MCollective/RPC/ActionRunner.html">MCollective::RPC::ActionRunner</a></li>
270                                 
271                                         <li><a href="../../MCollective/RPC/Agent.html">MCollective::RPC::Agent</a></li>
272                                 
273                                         <li><a href="../../MCollective/RPC/Audit.html">MCollective::RPC::Audit</a></li>
274                                 
275                                         <li><a href="../../MCollective/RPC/Client.html">MCollective::RPC::Client</a></li>
276                                 
277                                         <li><a href="../../MCollective/RPC/Helpers.html">MCollective::RPC::Helpers</a></li>
278                                 
279                                         <li><a href="../../MCollective/RPC/Progress.html">MCollective::RPC::Progress</a></li>
280                                 
281                                         <li><a href="../../MCollective/RPC/Reply.html">MCollective::RPC::Reply</a></li>
282                                 
283                                         <li><a href="../../MCollective/RPC/Request.html">MCollective::RPC::Request</a></li>
284                                 
285                                         <li><a href="../../MCollective/RPC/Result.html">MCollective::RPC::Result</a></li>
286                                 
287                                         <li><a href="../../MCollective/RPC/Stats.html">MCollective::RPC::Stats</a></li>
288                                 
289                                         <li><a href="../../MCollective/RPCAborted.html">MCollective::RPCAborted</a></li>
290                                 
291                                         <li><a href="../../MCollective/RPCError.html">MCollective::RPCError</a></li>
292                                 
293                                         <li><a href="../../MCollective/Registration.html">MCollective::Registration</a></li>
294                                 
295                                         <li><a href="../../MCollective/Registration/Base.html">MCollective::Registration::Base</a></li>
296                                 
297                                         <li><a href="../../MCollective/Runner.html">MCollective::Runner</a></li>
298                                 
299                                         <li><a href="../../MCollective/RunnerStats.html">MCollective::RunnerStats</a></li>
300                                 
301                                         <li><a href="../../MCollective/SSL.html">MCollective::SSL</a></li>
302                                 
303                                         <li><a href="../../MCollective/Security.html">MCollective::Security</a></li>
304                                 
305                                         <li><a href="../../MCollective/Security/Base.html">MCollective::Security::Base</a></li>
306                                 
307                                         <li><a href="../../MCollective/SecurityValidationFailed.html">MCollective::SecurityValidationFailed</a></li>
308                                 
309                                         <li><a href="../../MCollective/Shell.html">MCollective::Shell</a></li>
310                                 
311                                         <li><a href="../../MCollective/Translatable.html">MCollective::Translatable</a></li>
312                                 
313                                         <li><a href="../../MCollective/UnixDaemon.html">MCollective::UnixDaemon</a></li>
314                                 
315                                         <li><a href="../../MCollective/UnknownRPCAction.html">MCollective::UnknownRPCAction</a></li>
316                                 
317                                         <li><a href="../../MCollective/UnknownRPCError.html">MCollective::UnknownRPCError</a></li>
318                                 
319                                         <li><a href="../../MCollective/Util.html">MCollective::Util</a></li>
320                                 
321                                         <li><a href="../../MCollective/Validator.html">MCollective::Validator</a></li>
322                                 
323                                         <li><a href="../../MCollective/ValidatorError.html">MCollective::ValidatorError</a></li>
324                                 
325                                         <li><a href="../../MCollective/WindowsDaemon.html">MCollective::WindowsDaemon</a></li>
326                                 
327                                         <li><a href="../../Array.html">Array</a></li>
328                                 
329                                         <li><a href="../../Dir.html">Dir</a></li>
330                                 
331                                         <li><a href="../../Object.html">Object</a></li>
332                                 
333                                         <li><a href="../../String.html">String</a></li>
334                                 
335                                         <li><a href="../../Symbol.html">Symbol</a></li>
336                                 
337                                 </ul>
338                                 <div id="no-class-search-results" style="display: none;">No matching classes.</div>
339                         </div>
340
341                         
342                 </div>
343         </div>
344
345         <div id="documentation">
346                 <h1 class="class">MCollective::RPC::Result</h1>
347
348                 <div id="description">
349                         <p>
350 Simple class to manage compliant results from <a
351 href="../RPC.html">MCollective::RPC</a> agents
352 </p>
353 <p>
354 Currently it just fakes Hash behaviour to the result to remain backward
355 compatible but it also knows which agent and action produced it so you can
356 associate results to a <a href="../DDL.html">DDL</a>
357 </p>
358
359                 </div>
360
361                 <!-- Constants -->
362                 
363
364                 <!-- Attributes -->
365                 
366                 <div id="attribute-method-details" class="method-section section">
367                         <h3 class="section-header">Attributes</h3>
368
369                         
370                         <div id="agent-attribute-method" class="method-detail">
371                                 <a name="agent"></a>
372                                 
373                                 <div class="method-heading attribute-method-heading">
374                                         <span class="method-name">agent</span><span
375                                                 class="attribute-access-type">[R]</span>
376                                 </div>
377
378                                 <div class="method-description">
379                                 
380                                 <p class="missing-docs">(Not documented)</p>
381                                 
382                                 </div>
383                         </div>
384                         
385                         <div id="action-attribute-method" class="method-detail">
386                                 <a name="action"></a>
387                                 
388                                 <div class="method-heading attribute-method-heading">
389                                         <span class="method-name">action</span><span
390                                                 class="attribute-access-type">[R]</span>
391                                 </div>
392
393                                 <div class="method-description">
394                                 
395                                 <p class="missing-docs">(Not documented)</p>
396                                 
397                                 </div>
398                         </div>
399                         
400                         <div id="results-attribute-method" class="method-detail">
401                                 <a name="results"></a>
402                                 
403                                 <div class="method-heading attribute-method-heading">
404                                         <span class="method-name">results</span><span
405                                                 class="attribute-access-type">[R]</span>
406                                 </div>
407
408                                 <div class="method-description">
409                                 
410                                 <p class="missing-docs">(Not documented)</p>
411                                 
412                                 </div>
413                         </div>
414                         
415                 </div>
416                 
417
418                 <!-- Methods -->
419                 
420                 <div id="public-class-method-details" class="method-section section">
421                         <h3 class="section-header">Public Class Methods</h3>
422
423                 
424                         <div id="new-method" class="method-detail ">
425                                 <a name="M000428"></a>
426
427                                 <div class="method-heading">
428                                 
429                                         <span class="method-name">new</span><span
430                                                 class="method-args">(agent, action, result={})</span>
431                                         <span class="method-click-advice">click to toggle source</span>
432                                 
433                                 </div>
434
435                                 <div class="method-description">
436                                         
437                                         <p class="missing-docs">(Not documented)</p>
438                                         
439
440                                         
441                                         <div class="method-source-code"
442                                                 id="new-source">
443 <pre>
444     <span class="ruby-comment cmt"># File lib/mcollective/rpc/result.rb, line 13</span>
445 13:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">agent</span>, <span class="ruby-identifier">action</span>, <span class="ruby-identifier">result</span>={})
446 14:         <span class="ruby-ivar">@agent</span> = <span class="ruby-identifier">agent</span>
447 15:         <span class="ruby-ivar">@action</span> = <span class="ruby-identifier">action</span>
448 16:         <span class="ruby-ivar">@results</span> = <span class="ruby-identifier">result</span>
449 17:       <span class="ruby-keyword kw">end</span></pre>
450                                         </div>
451                                         
452                                 </div>
453
454                                 
455                         </div>
456
457                 
458                 </div>
459         
460                 <div id="public-instance-method-details" class="method-section section">
461                         <h3 class="section-header">Public Instance Methods</h3>
462
463                 
464                         <div id="--method" class="method-detail ">
465                                 <a name="M000429"></a>
466
467                                 <div class="method-heading">
468                                 
469                                         <span class="method-name">[]</span><span
470                                                 class="method-args">(idx)</span>
471                                         <span class="method-click-advice">click to toggle source</span>
472                                 
473                                 </div>
474
475                                 <div class="method-description">
476                                         
477                                         <p class="missing-docs">(Not documented)</p>
478                                         
479
480                                         
481                                         <div class="method-source-code"
482                                                 id="--source">
483 <pre>
484     <span class="ruby-comment cmt"># File lib/mcollective/rpc/result.rb, line 19</span>
485 19:       <span class="ruby-keyword kw">def</span> <span class="ruby-operator">[]</span>(<span class="ruby-identifier">idx</span>)
486 20:         <span class="ruby-ivar">@results</span>[<span class="ruby-identifier">idx</span>]
487 21:       <span class="ruby-keyword kw">end</span></pre>
488                                         </div>
489                                         
490                                 </div>
491
492                                 
493                         </div>
494
495                 
496                         <div id="--method" class="method-detail ">
497                                 <a name="M000430"></a>
498
499                                 <div class="method-heading">
500                                 
501                                         <span class="method-name">[]=</span><span
502                                                 class="method-args">(idx, item)</span>
503                                         <span class="method-click-advice">click to toggle source</span>
504                                 
505                                 </div>
506
507                                 <div class="method-description">
508                                         
509                                         <p class="missing-docs">(Not documented)</p>
510                                         
511
512                                         
513                                         <div class="method-source-code"
514                                                 id="--source">
515 <pre>
516     <span class="ruby-comment cmt"># File lib/mcollective/rpc/result.rb, line 23</span>
517 23:       <span class="ruby-keyword kw">def</span> <span class="ruby-operator">[]=</span>(<span class="ruby-identifier">idx</span>, <span class="ruby-identifier">item</span>)
518 24:         <span class="ruby-ivar">@results</span>[<span class="ruby-identifier">idx</span>] = <span class="ruby-identifier">item</span>
519 25:       <span class="ruby-keyword kw">end</span></pre>
520                                         </div>
521                                         
522                                 </div>
523
524                                 
525                         </div>
526
527                 
528                         <div id="each-method" class="method-detail ">
529                                 <a name="M000432"></a>
530
531                                 <div class="method-heading">
532                                 
533                                         <span class="method-name">each</span><span
534                                                 class="method-args">()</span>
535                                         <span class="method-click-advice">click to toggle source</span>
536                                 
537                                 </div>
538
539                                 <div class="method-description">
540                                         
541                                         <p class="missing-docs">(Not documented)</p>
542                                         
543
544                                         
545                                         <div class="method-source-code"
546                                                 id="each-source">
547 <pre>
548     <span class="ruby-comment cmt"># File lib/mcollective/rpc/result.rb, line 31</span>
549 31:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">each</span>
550 32:         <span class="ruby-ivar">@results</span>.<span class="ruby-identifier">each_pair</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-keyword kw">yield</span>(<span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span>) }
551 33:       <span class="ruby-keyword kw">end</span></pre>
552                                         </div>
553                                         
554                                 </div>
555
556                                 
557                         </div>
558
559                 
560                         <div id="fetch-method" class="method-detail ">
561                                 <a name="M000431"></a>
562
563                                 <div class="method-heading">
564                                 
565                                         <span class="method-name">fetch</span><span
566                                                 class="method-args">(key, default)</span>
567                                         <span class="method-click-advice">click to toggle source</span>
568                                 
569                                 </div>
570
571                                 <div class="method-description">
572                                         
573                                         <p class="missing-docs">(Not documented)</p>
574                                         
575
576                                         
577                                         <div class="method-source-code"
578                                                 id="fetch-source">
579 <pre>
580     <span class="ruby-comment cmt"># File lib/mcollective/rpc/result.rb, line 27</span>
581 27:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">fetch</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">default</span>)
582 28:         <span class="ruby-ivar">@results</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">default</span>)
583 29:       <span class="ruby-keyword kw">end</span></pre>
584                                         </div>
585                                         
586                                 </div>
587
588                                 
589                         </div>
590
591                 
592                         <div id="to-json-method" class="method-detail ">
593                                 <a name="M000433"></a>
594
595                                 <div class="method-heading">
596                                 
597                                         <span class="method-name">to_json</span><span
598                                                 class="method-args">(*a)</span>
599                                         <span class="method-click-advice">click to toggle source</span>
600                                 
601                                 </div>
602
603                                 <div class="method-description">
604                                         
605                                         <p class="missing-docs">(Not documented)</p>
606                                         
607
608                                         
609                                         <div class="method-source-code"
610                                                 id="to-json-source">
611 <pre>
612     <span class="ruby-comment cmt"># File lib/mcollective/rpc/result.rb, line 35</span>
613 35:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_json</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">a</span>)
614 36:         {<span class="ruby-identifier">:agent</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@agent</span>,
615 37:          <span class="ruby-identifier">:action</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@action</span>,
616 38:          <span class="ruby-identifier">:sender</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@results</span>[<span class="ruby-identifier">:sender</span>],
617 39:          <span class="ruby-identifier">:statuscode</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@results</span>[<span class="ruby-identifier">:statuscode</span>],
618 40:          <span class="ruby-identifier">:statusmsg</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@results</span>[<span class="ruby-identifier">:statusmsg</span>],
619 41:          <span class="ruby-identifier">:data</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@results</span>[<span class="ruby-identifier">:data</span>]}.<span class="ruby-identifier">to_json</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">a</span>)
620 42:       <span class="ruby-keyword kw">end</span></pre>
621                                         </div>
622                                         
623                                 </div>
624
625                                 
626                         </div>
627
628                 
629                 </div>
630         
631
632         </div>
633
634
635         <div id="rdoc-debugging-section-dump" class="debugging-section">
636         
637                 <p>Disabled; run with --debug to generate this.</p>
638         
639         </div>
640
641         <div id="validator-badges">
642                 <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
643                 <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
644                         Rdoc Generator</a> 1.1.6</small>.</p>
645         </div>
646
647 </body>
648 </html>
649