Update version according to OSCI-883
[packages/precise/mcollective.git] / doc / MCollective / RPC / Request.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::Request</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/request_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
32                                                         class="thickbox" title="lib/mcollective/rpc/request.rb">lib/mcollective/rpc/request.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="#M000396">::new</a></li>
63                                         
64                                         <li><a href="#M000399">#[]</a></li>
65                                         
66                                         <li><a href="#M000400">#fetch</a></li>
67                                         
68                                         <li><a href="#M000397">#include?</a></li>
69                                         
70                                         <li><a href="#M000398">#should_respond?</a></li>
71                                         
72                                         <li><a href="#M000401">#to_hash</a></li>
73                                         
74                                         <li><a href="#M000403">#to_json</a></li>
75                                         
76                                         <li><a href="#M000402">#validate!</a></li>
77                                         
78                                 </ul>
79                         </div>
80                         
81
82                         <!-- Included Modules -->
83                         
84                 </div>
85
86                 <div id="project-metadata">
87                         
88                         
89                         <div id="fileindex-section" class="section project-section">
90                                 <h3 class="section-header">Files</h3>
91                                 <ul>
92                                 
93                                         <li class="file"><a href="../../COPYING.html">COPYING</a></li>
94                                 
95                                         <li class="file"><a href="../../Gemfile.html">Gemfile</a></li>
96                                 
97                                         <li class="file"><a href="../../README.html">README</a></li>
98                                 
99                                         <li class="file"><a href="../../Rakefile.html">Rakefile</a></li>
100                                 
101                                         <li class="file"><a href="../../etc/client_cfg_dist.html">client.cfg.dist</a></li>
102                                 
103                                         <li class="file"><a href="../../etc/data-help_erb.html">data-help.erb</a></li>
104                                 
105                                         <li class="file"><a href="../../etc/discovery-help_erb.html">discovery-help.erb</a></li>
106                                 
107                                         <li class="file"><a href="../../etc/facts_yaml_dist.html">facts.yaml.dist</a></li>
108                                 
109                                         <li class="file"><a href="../../etc/metadata-help_erb.html">metadata-help.erb</a></li>
110                                 
111                                         <li class="file"><a href="../../etc/msg-help_erb.html">msg-help.erb</a></li>
112                                 
113                                         <li class="file"><a href="../../etc/rpc-help_erb.html">rpc-help.erb</a></li>
114                                 
115                                         <li class="file"><a href="../../etc/server_cfg_dist.html">server.cfg.dist</a></li>
116                                 
117                                         <li class="file"><a href="../../etc/ssl/PLACEHOLDER.html">PLACEHOLDER</a></li>
118                                 
119                                         <li class="file"><a href="../../etc/ssl/clients/PLACEHOLDER.html">PLACEHOLDER</a></li>
120                                 
121                                         <li class="file"><a href="../../lib/mcollective/generators/templates/action_snippet_erb.html">action_snippet.erb</a></li>
122                                 
123                                         <li class="file"><a href="../../lib/mcollective/generators/templates/data_input_snippet_erb.html">data_input_snippet.erb</a></li>
124                                 
125                                         <li class="file"><a href="../../lib/mcollective/generators/templates/ddl_erb.html">ddl.erb</a></li>
126                                 
127                                         <li class="file"><a href="../../lib/mcollective/generators/templates/plugin_erb.html">plugin.erb</a></li>
128                                 
129                                         <li class="file"><a href="../../lib/mcollective/locales/en_yml.html">en.yml</a></li>
130                                 
131                                         <li class="file"><a href="../../mcollective_init.html">mcollective.init</a></li>
132                                 
133                                 </ul>
134                         </div>
135                         
136
137                         <div id="classindex-section" class="section project-section">
138                                 <h3 class="section-header">Class Index
139                                         <span class="search-toggle"><img src="../../images/find.png"
140                                                 height="16" width="16" alt="[+]"
141                                                 title="show/hide quicksearch" /></span></h3>
142                                 <form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
143                                 <fieldset>
144                                         <legend>Quicksearch</legend>
145                                         <input type="text" name="quicksearch" value=""
146                                                 class="quicksearch-field" />
147                                 </fieldset>
148                                 </form>
149
150                                 <ul class="link-list">
151                                 
152                                         <li><a href="../../MCollective.html">MCollective</a></li>
153                                 
154                                         <li><a href="../../MCollective/Agent.html">MCollective::Agent</a></li>
155                                 
156                                         <li><a href="../../MCollective/Agents.html">MCollective::Agents</a></li>
157                                 
158                                         <li><a href="../../MCollective/Aggregate.html">MCollective::Aggregate</a></li>
159                                 
160                                         <li><a href="../../MCollective/Aggregate/Base.html">MCollective::Aggregate::Base</a></li>
161                                 
162                                         <li><a href="../../MCollective/Aggregate/Result.html">MCollective::Aggregate::Result</a></li>
163                                 
164                                         <li><a href="../../MCollective/Aggregate/Result/Base.html">MCollective::Aggregate::Result::Base</a></li>
165                                 
166                                         <li><a href="../../MCollective/Aggregate/Result/CollectionResult.html">MCollective::Aggregate::Result::CollectionResult</a></li>
167                                 
168                                         <li><a href="../../MCollective/Aggregate/Result/NumericResult.html">MCollective::Aggregate::Result::NumericResult</a></li>
169                                 
170                                         <li><a href="../../MCollective/Application.html">MCollective::Application</a></li>
171                                 
172                                         <li><a href="../../MCollective/Applications.html">MCollective::Applications</a></li>
173                                 
174                                         <li><a href="../../MCollective/Cache.html">MCollective::Cache</a></li>
175                                 
176                                         <li><a href="../../MCollective/Client.html">MCollective::Client</a></li>
177                                 
178                                         <li><a href="../../MCollective/CodedError.html">MCollective::CodedError</a></li>
179                                 
180                                         <li><a href="../../MCollective/Config.html">MCollective::Config</a></li>
181                                 
182                                         <li><a href="../../MCollective/Connector.html">MCollective::Connector</a></li>
183                                 
184                                         <li><a href="../../MCollective/Connector/Base.html">MCollective::Connector::Base</a></li>
185                                 
186                                         <li><a href="../../MCollective/DDL.html">MCollective::DDL</a></li>
187                                 
188                                         <li><a href="../../MCollective/DDL/AgentDDL.html">MCollective::DDL::AgentDDL</a></li>
189                                 
190                                         <li><a href="../../MCollective/DDL/Base.html">MCollective::DDL::Base</a></li>
191                                 
192                                         <li><a href="../../MCollective/DDL/DataDDL.html">MCollective::DDL::DataDDL</a></li>
193                                 
194                                         <li><a href="../../MCollective/DDL/DiscoveryDDL.html">MCollective::DDL::DiscoveryDDL</a></li>
195                                 
196                                         <li><a href="../../MCollective/DDL/ValidatorDDL.html">MCollective::DDL::ValidatorDDL</a></li>
197                                 
198                                         <li><a href="../../MCollective/DDLValidationError.html">MCollective::DDLValidationError</a></li>
199                                 
200                                         <li><a href="../../MCollective/Data.html">MCollective::Data</a></li>
201                                 
202                                         <li><a href="../../MCollective/Data/Base.html">MCollective::Data::Base</a></li>
203                                 
204                                         <li><a href="../../MCollective/Data/Result.html">MCollective::Data::Result</a></li>
205                                 
206                                         <li><a href="../../MCollective/Discovery.html">MCollective::Discovery</a></li>
207                                 
208                                         <li><a href="../../MCollective/Facts.html">MCollective::Facts</a></li>
209                                 
210                                         <li><a href="../../MCollective/Facts/Base.html">MCollective::Facts::Base</a></li>
211                                 
212                                         <li><a href="../../MCollective/Generators.html">MCollective::Generators</a></li>
213                                 
214                                         <li><a href="../../MCollective/Generators/AgentGenerator.html">MCollective::Generators::AgentGenerator</a></li>
215                                 
216                                         <li><a href="../../MCollective/Generators/Base.html">MCollective::Generators::Base</a></li>
217                                 
218                                         <li><a href="../../MCollective/Generators/DataGenerator.html">MCollective::Generators::DataGenerator</a></li>
219                                 
220                                         <li><a href="../../MCollective/InvalidRPCData.html">MCollective::InvalidRPCData</a></li>
221                                 
222                                         <li><a href="../../MCollective/Log.html">MCollective::Log</a></li>
223                                 
224                                         <li><a href="../../MCollective/Logger.html">MCollective::Logger</a></li>
225                                 
226                                         <li><a href="../../MCollective/Logger/Base.html">MCollective::Logger::Base</a></li>
227                                 
228                                         <li><a href="../../MCollective/Logger/Console_logger.html">MCollective::Logger::Console_logger</a></li>
229                                 
230                                         <li><a href="../../MCollective/Logger/File_logger.html">MCollective::Logger::File_logger</a></li>
231                                 
232                                         <li><a href="../../MCollective/Logger/Syslog_logger.html">MCollective::Logger::Syslog_logger</a></li>
233                                 
234                                         <li><a href="../../MCollective/Matcher.html">MCollective::Matcher</a></li>
235                                 
236                                         <li><a href="../../MCollective/Matcher/Parser.html">MCollective::Matcher::Parser</a></li>
237                                 
238                                         <li><a href="../../MCollective/Matcher/Scanner.html">MCollective::Matcher::Scanner</a></li>
239                                 
240                                         <li><a href="../../MCollective/Message.html">MCollective::Message</a></li>
241                                 
242                                         <li><a href="../../MCollective/MissingRPCData.html">MCollective::MissingRPCData</a></li>
243                                 
244                                         <li><a href="../../MCollective/MsgDoesNotMatchRequestID.html">MCollective::MsgDoesNotMatchRequestID</a></li>
245                                 
246                                         <li><a href="../../MCollective/MsgTTLExpired.html">MCollective::MsgTTLExpired</a></li>
247                                 
248                                         <li><a href="../../MCollective/NotTargettedAtUs.html">MCollective::NotTargettedAtUs</a></li>
249                                 
250                                         <li><a href="../../MCollective/Optionparser.html">MCollective::Optionparser</a></li>
251                                 
252                                         <li><a href="../../MCollective/PluginManager.html">MCollective::PluginManager</a></li>
253                                 
254                                         <li><a href="../../MCollective/PluginPackager.html">MCollective::PluginPackager</a></li>
255                                 
256                                         <li><a href="../../MCollective/PluginPackager/AgentDefinition.html">MCollective::PluginPackager::AgentDefinition</a></li>
257                                 
258                                         <li><a href="../../MCollective/PluginPackager/StandardDefinition.html">MCollective::PluginPackager::StandardDefinition</a></li>
259                                 
260                                         <li><a href="../../MCollective/RPC.html">MCollective::RPC</a></li>
261                                 
262                                         <li><a href="../../MCollective/RPC/ActionRunner.html">MCollective::RPC::ActionRunner</a></li>
263                                 
264                                         <li><a href="../../MCollective/RPC/Agent.html">MCollective::RPC::Agent</a></li>
265                                 
266                                         <li><a href="../../MCollective/RPC/Audit.html">MCollective::RPC::Audit</a></li>
267                                 
268                                         <li><a href="../../MCollective/RPC/Client.html">MCollective::RPC::Client</a></li>
269                                 
270                                         <li><a href="../../MCollective/RPC/Helpers.html">MCollective::RPC::Helpers</a></li>
271                                 
272                                         <li><a href="../../MCollective/RPC/Progress.html">MCollective::RPC::Progress</a></li>
273                                 
274                                         <li><a href="../../MCollective/RPC/Reply.html">MCollective::RPC::Reply</a></li>
275                                 
276                                         <li><a href="../../MCollective/RPC/Request.html">MCollective::RPC::Request</a></li>
277                                 
278                                         <li><a href="../../MCollective/RPC/Result.html">MCollective::RPC::Result</a></li>
279                                 
280                                         <li><a href="../../MCollective/RPC/Stats.html">MCollective::RPC::Stats</a></li>
281                                 
282                                         <li><a href="../../MCollective/RPCAborted.html">MCollective::RPCAborted</a></li>
283                                 
284                                         <li><a href="../../MCollective/RPCError.html">MCollective::RPCError</a></li>
285                                 
286                                         <li><a href="../../MCollective/Registration.html">MCollective::Registration</a></li>
287                                 
288                                         <li><a href="../../MCollective/Registration/Base.html">MCollective::Registration::Base</a></li>
289                                 
290                                         <li><a href="../../MCollective/Runner.html">MCollective::Runner</a></li>
291                                 
292                                         <li><a href="../../MCollective/RunnerStats.html">MCollective::RunnerStats</a></li>
293                                 
294                                         <li><a href="../../MCollective/SSL.html">MCollective::SSL</a></li>
295                                 
296                                         <li><a href="../../MCollective/Security.html">MCollective::Security</a></li>
297                                 
298                                         <li><a href="../../MCollective/Security/Base.html">MCollective::Security::Base</a></li>
299                                 
300                                         <li><a href="../../MCollective/SecurityValidationFailed.html">MCollective::SecurityValidationFailed</a></li>
301                                 
302                                         <li><a href="../../MCollective/Shell.html">MCollective::Shell</a></li>
303                                 
304                                         <li><a href="../../MCollective/Translatable.html">MCollective::Translatable</a></li>
305                                 
306                                         <li><a href="../../MCollective/UnixDaemon.html">MCollective::UnixDaemon</a></li>
307                                 
308                                         <li><a href="../../MCollective/UnknownRPCAction.html">MCollective::UnknownRPCAction</a></li>
309                                 
310                                         <li><a href="../../MCollective/UnknownRPCError.html">MCollective::UnknownRPCError</a></li>
311                                 
312                                         <li><a href="../../MCollective/Util.html">MCollective::Util</a></li>
313                                 
314                                         <li><a href="../../MCollective/Validator.html">MCollective::Validator</a></li>
315                                 
316                                         <li><a href="../../MCollective/ValidatorError.html">MCollective::ValidatorError</a></li>
317                                 
318                                         <li><a href="../../MCollective/WindowsDaemon.html">MCollective::WindowsDaemon</a></li>
319                                 
320                                         <li><a href="../../Array.html">Array</a></li>
321                                 
322                                         <li><a href="../../Dir.html">Dir</a></li>
323                                 
324                                         <li><a href="../../Object.html">Object</a></li>
325                                 
326                                         <li><a href="../../String.html">String</a></li>
327                                 
328                                         <li><a href="../../Symbol.html">Symbol</a></li>
329                                 
330                                 </ul>
331                                 <div id="no-class-search-results" style="display: none;">No matching classes.</div>
332                         </div>
333
334                         
335                 </div>
336         </div>
337
338         <div id="documentation">
339                 <h1 class="class">MCollective::RPC::Request</h1>
340
341                 <div id="description">
342                         <p>
343 Simple class to manage compliant requests for <a
344 href="../RPC.html">MCollective::RPC</a> agents
345 </p>
346
347                 </div>
348
349                 <!-- Constants -->
350                 
351
352                 <!-- Attributes -->
353                 
354                 <div id="attribute-method-details" class="method-section section">
355                         <h3 class="section-header">Attributes</h3>
356
357                         
358                         <div id="time-attribute-method" class="method-detail">
359                                 <a name="time"></a>
360                                 
361                                 <a name="time="></a>
362                                 
363                                 <div class="method-heading attribute-method-heading">
364                                         <span class="method-name">time</span><span
365                                                 class="attribute-access-type">[RW]</span>
366                                 </div>
367
368                                 <div class="method-description">
369                                 
370                                 <p class="missing-docs">(Not documented)</p>
371                                 
372                                 </div>
373                         </div>
374                         
375                         <div id="action-attribute-method" class="method-detail">
376                                 <a name="action"></a>
377                                 
378                                 <a name="action="></a>
379                                 
380                                 <div class="method-heading attribute-method-heading">
381                                         <span class="method-name">action</span><span
382                                                 class="attribute-access-type">[RW]</span>
383                                 </div>
384
385                                 <div class="method-description">
386                                 
387                                 <p class="missing-docs">(Not documented)</p>
388                                 
389                                 </div>
390                         </div>
391                         
392                         <div id="data-attribute-method" class="method-detail">
393                                 <a name="data"></a>
394                                 
395                                 <a name="data="></a>
396                                 
397                                 <div class="method-heading attribute-method-heading">
398                                         <span class="method-name">data</span><span
399                                                 class="attribute-access-type">[RW]</span>
400                                 </div>
401
402                                 <div class="method-description">
403                                 
404                                 <p class="missing-docs">(Not documented)</p>
405                                 
406                                 </div>
407                         </div>
408                         
409                         <div id="sender-attribute-method" class="method-detail">
410                                 <a name="sender"></a>
411                                 
412                                 <a name="sender="></a>
413                                 
414                                 <div class="method-heading attribute-method-heading">
415                                         <span class="method-name">sender</span><span
416                                                 class="attribute-access-type">[RW]</span>
417                                 </div>
418
419                                 <div class="method-description">
420                                 
421                                 <p class="missing-docs">(Not documented)</p>
422                                 
423                                 </div>
424                         </div>
425                         
426                         <div id="agent-attribute-method" class="method-detail">
427                                 <a name="agent"></a>
428                                 
429                                 <a name="agent="></a>
430                                 
431                                 <div class="method-heading attribute-method-heading">
432                                         <span class="method-name">agent</span><span
433                                                 class="attribute-access-type">[RW]</span>
434                                 </div>
435
436                                 <div class="method-description">
437                                 
438                                 <p class="missing-docs">(Not documented)</p>
439                                 
440                                 </div>
441                         </div>
442                         
443                         <div id="uniqid-attribute-method" class="method-detail">
444                                 <a name="uniqid"></a>
445                                 
446                                 <a name="uniqid="></a>
447                                 
448                                 <div class="method-heading attribute-method-heading">
449                                         <span class="method-name">uniqid</span><span
450                                                 class="attribute-access-type">[RW]</span>
451                                 </div>
452
453                                 <div class="method-description">
454                                 
455                                 <p class="missing-docs">(Not documented)</p>
456                                 
457                                 </div>
458                         </div>
459                         
460                         <div id="caller-attribute-method" class="method-detail">
461                                 <a name="caller"></a>
462                                 
463                                 <a name="caller="></a>
464                                 
465                                 <div class="method-heading attribute-method-heading">
466                                         <span class="method-name">caller</span><span
467                                                 class="attribute-access-type">[RW]</span>
468                                 </div>
469
470                                 <div class="method-description">
471                                 
472                                 <p class="missing-docs">(Not documented)</p>
473                                 
474                                 </div>
475                         </div>
476                         
477                         <div id="ddl-attribute-method" class="method-detail">
478                                 <a name="ddl"></a>
479                                 
480                                 <a name="ddl="></a>
481                                 
482                                 <div class="method-heading attribute-method-heading">
483                                         <span class="method-name">ddl</span><span
484                                                 class="attribute-access-type">[RW]</span>
485                                 </div>
486
487                                 <div class="method-description">
488                                 
489                                 <p class="missing-docs">(Not documented)</p>
490                                 
491                                 </div>
492                         </div>
493                         
494                 </div>
495                 
496
497                 <!-- Methods -->
498                 
499                 <div id="public-class-method-details" class="method-section section">
500                         <h3 class="section-header">Public Class Methods</h3>
501
502                 
503                         <div id="new-method" class="method-detail ">
504                                 <a name="M000396"></a>
505
506                                 <div class="method-heading">
507                                 
508                                         <span class="method-name">new</span><span
509                                                 class="method-args">(msg, ddl)</span>
510                                         <span class="method-click-advice">click to toggle source</span>
511                                 
512                                 </div>
513
514                                 <div class="method-description">
515                                         
516                                         <p class="missing-docs">(Not documented)</p>
517                                         
518
519                                         
520                                         <div class="method-source-code"
521                                                 id="new-source">
522 <pre>
523     <span class="ruby-comment cmt"># File lib/mcollective/rpc/request.rb, line 7</span>
524  7:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">msg</span>, <span class="ruby-identifier">ddl</span>)
525  8:         <span class="ruby-ivar">@time</span> = <span class="ruby-identifier">msg</span>[<span class="ruby-identifier">:msgtime</span>]
526  9:         <span class="ruby-ivar">@action</span> = <span class="ruby-identifier">msg</span>[<span class="ruby-identifier">:body</span>][<span class="ruby-identifier">:action</span>]
527 10:         <span class="ruby-ivar">@data</span> = <span class="ruby-identifier">msg</span>[<span class="ruby-identifier">:body</span>][<span class="ruby-identifier">:data</span>]
528 11:         <span class="ruby-ivar">@sender</span> = <span class="ruby-identifier">msg</span>[<span class="ruby-identifier">:senderid</span>]
529 12:         <span class="ruby-ivar">@agent</span> = <span class="ruby-identifier">msg</span>[<span class="ruby-identifier">:body</span>][<span class="ruby-identifier">:agent</span>]
530 13:         <span class="ruby-ivar">@uniqid</span> = <span class="ruby-identifier">msg</span>[<span class="ruby-identifier">:requestid</span>]
531 14:         <span class="ruby-ivar">@caller</span> = <span class="ruby-identifier">msg</span>[<span class="ruby-identifier">:callerid</span>] <span class="ruby-operator">||</span> <span class="ruby-value str">&quot;unknown&quot;</span>
532 15:         <span class="ruby-ivar">@ddl</span> = <span class="ruby-identifier">ddl</span>
533 16:       <span class="ruby-keyword kw">end</span></pre>
534                                         </div>
535                                         
536                                 </div>
537
538                                 
539                         </div>
540
541                 
542                 </div>
543         
544                 <div id="public-instance-method-details" class="method-section section">
545                         <h3 class="section-header">Public Instance Methods</h3>
546
547                 
548                         <div id="--method" class="method-detail ">
549                                 <a name="M000399"></a>
550
551                                 <div class="method-heading">
552                                 
553                                         <span class="method-name">[]</span><span
554                                                 class="method-args">(key)</span>
555                                         <span class="method-click-advice">click to toggle source</span>
556                                 
557                                 </div>
558
559                                 <div class="method-description">
560                                         
561                                         <p>
562 If data is a hash, gives easy access to its members, else returns nil
563 </p>
564                                         
565
566                                         
567                                         <div class="method-source-code"
568                                                 id="--source">
569 <pre>
570     <span class="ruby-comment cmt"># File lib/mcollective/rpc/request.rb, line 34</span>
571 34:       <span class="ruby-keyword kw">def</span> <span class="ruby-operator">[]</span>(<span class="ruby-identifier">key</span>)
572 35:         <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@data</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Hash</span>)
573 36:         <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@data</span>[<span class="ruby-identifier">key</span>]
574 37:       <span class="ruby-keyword kw">end</span></pre>
575                                         </div>
576                                         
577                                 </div>
578
579                                 
580                         </div>
581
582                 
583                         <div id="fetch-method" class="method-detail ">
584                                 <a name="M000400"></a>
585
586                                 <div class="method-heading">
587                                 
588                                         <span class="method-name">fetch</span><span
589                                                 class="method-args">(key, default)</span>
590                                         <span class="method-click-advice">click to toggle source</span>
591                                 
592                                 </div>
593
594                                 <div class="method-description">
595                                         
596                                         <p class="missing-docs">(Not documented)</p>
597                                         
598
599                                         
600                                         <div class="method-source-code"
601                                                 id="fetch-source">
602 <pre>
603     <span class="ruby-comment cmt"># File lib/mcollective/rpc/request.rb, line 39</span>
604 39:       <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>)
605 40:         <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@data</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Hash</span>)
606 41:         <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@data</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">default</span>)
607 42:       <span class="ruby-keyword kw">end</span></pre>
608                                         </div>
609                                         
610                                 </div>
611
612                                 
613                         </div>
614
615                 
616                         <div id="include--method" class="method-detail ">
617                                 <a name="M000397"></a>
618
619                                 <div class="method-heading">
620                                 
621                                         <span class="method-name">include?</span><span
622                                                 class="method-args">(key)</span>
623                                         <span class="method-click-advice">click to toggle source</span>
624                                 
625                                 </div>
626
627                                 <div class="method-description">
628                                         
629                                         <p>
630 If data is a hash, quick helper to get access to it&#8217;s include? method
631 else returns false
632 </p>
633                                         
634
635                                         
636                                         <div class="method-source-code"
637                                                 id="include--source">
638 <pre>
639     <span class="ruby-comment cmt"># File lib/mcollective/rpc/request.rb, line 20</span>
640 20:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">include?</span>(<span class="ruby-identifier">key</span>)
641 21:         <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@data</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Hash</span>)
642 22:         <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@data</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">key</span>)
643 23:       <span class="ruby-keyword kw">end</span></pre>
644                                         </div>
645                                         
646                                 </div>
647
648                                 
649                         </div>
650
651                 
652                         <div id="should-respond--method" class="method-detail ">
653                                 <a name="M000398"></a>
654
655                                 <div class="method-heading">
656                                 
657                                         <span class="method-name">should_respond?</span><span
658                                                 class="method-args">()</span>
659                                         <span class="method-click-advice">click to toggle source</span>
660                                 
661                                 </div>
662
663                                 <div class="method-description">
664                                         
665                                         <p>
666 If no :process_results is specified always respond else respond based on
667 the supplied property
668 </p>
669                                         
670
671                                         
672                                         <div class="method-source-code"
673                                                 id="should-respond--source">
674 <pre>
675     <span class="ruby-comment cmt"># File lib/mcollective/rpc/request.rb, line 27</span>
676 27:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">should_respond?</span>
677 28:         <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@data</span>[<span class="ruby-identifier">:process_results</span>] <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@data</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">:process_results</span>)
678 29: 
679 30:         <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span>
680 31:       <span class="ruby-keyword kw">end</span></pre>
681                                         </div>
682                                         
683                                 </div>
684
685                                 
686                         </div>
687
688                 
689                         <div id="to-hash-method" class="method-detail ">
690                                 <a name="M000401"></a>
691
692                                 <div class="method-heading">
693                                 
694                                         <span class="method-name">to_hash</span><span
695                                                 class="method-args">()</span>
696                                         <span class="method-click-advice">click to toggle source</span>
697                                 
698                                 </div>
699
700                                 <div class="method-description">
701                                         
702                                         <p class="missing-docs">(Not documented)</p>
703                                         
704
705                                         
706                                         <div class="method-source-code"
707                                                 id="to-hash-source">
708 <pre>
709     <span class="ruby-comment cmt"># File lib/mcollective/rpc/request.rb, line 44</span>
710 44:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_hash</span>
711 45:         <span class="ruby-keyword kw">return</span> {<span class="ruby-identifier">:agent</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@agent</span>,
712 46:                 <span class="ruby-identifier">:action</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@action</span>,
713 47:                 <span class="ruby-identifier">:data</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@data</span>}
714 48:       <span class="ruby-keyword kw">end</span></pre>
715                                         </div>
716                                         
717                                 </div>
718
719                                 
720                         </div>
721
722                 
723                         <div id="to-json-method" class="method-detail ">
724                                 <a name="M000403"></a>
725
726                                 <div class="method-heading">
727                                 
728                                         <span class="method-name">to_json</span><span
729                                                 class="method-args">()</span>
730                                         <span class="method-click-advice">click to toggle source</span>
731                                 
732                                 </div>
733
734                                 <div class="method-description">
735                                         
736                                         <p class="missing-docs">(Not documented)</p>
737                                         
738
739                                         
740                                         <div class="method-source-code"
741                                                 id="to-json-source">
742 <pre>
743     <span class="ruby-comment cmt"># File lib/mcollective/rpc/request.rb, line 55</span>
744 55:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_json</span>
745 56:         <span class="ruby-identifier">to_hash</span>.<span class="ruby-identifier">merge!</span>({<span class="ruby-identifier">:sender</span>   =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@sender</span>,
746 57:                         <span class="ruby-identifier">:callerid</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@callerid</span>,
747 58:                         <span class="ruby-identifier">:uniqid</span>   =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@uniqid</span>}).<span class="ruby-identifier">to_json</span>
748 59:       <span class="ruby-keyword kw">end</span></pre>
749                                         </div>
750                                         
751                                 </div>
752
753                                 
754                         </div>
755
756                 
757                         <div id="validate--method" class="method-detail ">
758                                 <a name="M000402"></a>
759
760                                 <div class="method-heading">
761                                 
762                                         <span class="method-name">validate!</span><span
763                                                 class="method-args">()</span>
764                                         <span class="method-click-advice">click to toggle source</span>
765                                 
766                                 </div>
767
768                                 <div class="method-description">
769                                         
770                                         <p>
771 Validate the request against the <a href="../DDL.html">DDL</a>
772 </p>
773                                         
774
775                                         
776                                         <div class="method-source-code"
777                                                 id="validate--source">
778 <pre>
779     <span class="ruby-comment cmt"># File lib/mcollective/rpc/request.rb, line 51</span>
780 51:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">validate!</span>
781 52:         <span class="ruby-ivar">@ddl</span>.<span class="ruby-identifier">validate_rpc_request</span>(<span class="ruby-ivar">@action</span>, <span class="ruby-ivar">@data</span>)
782 53:       <span class="ruby-keyword kw">end</span></pre>
783                                         </div>
784                                         
785                                 </div>
786
787                                 
788                         </div>
789
790                 
791                 </div>
792         
793
794         </div>
795
796
797         <div id="rdoc-debugging-section-dump" class="debugging-section">
798         
799                 <p>Disabled; run with --debug to generate this.</p>
800         
801         </div>
802
803         <div id="validator-badges">
804                 <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
805                 <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
806                         Rdoc Generator</a> 1.1.6</small>.</p>
807         </div>
808
809 </body>
810 </html>
811