marilyn-rpc 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. data/LICENCE +18 -0
  2. data/README.md +170 -0
  3. data/doc/MarilynRPC/CallRequestMail.html +578 -0
  4. data/doc/MarilynRPC/CallResponseMail.html +418 -0
  5. data/doc/MarilynRPC/Envelope.html +705 -0
  6. data/doc/MarilynRPC/ExceptionMail.html +338 -0
  7. data/doc/MarilynRPC/Gentleman.html +658 -0
  8. data/doc/MarilynRPC/MailFactory.html +284 -0
  9. data/doc/MarilynRPC/MailHelper.html +489 -0
  10. data/doc/MarilynRPC/NativeClient.html +579 -0
  11. data/doc/MarilynRPC/NativeClientProxy.html +303 -0
  12. data/doc/MarilynRPC/Server.html +406 -0
  13. data/doc/MarilynRPC/Service.html +599 -0
  14. data/doc/MarilynRPC/ServiceCache.html +481 -0
  15. data/doc/MarilynRPC.html +108 -0
  16. data/doc/_index.html +219 -0
  17. data/doc/class_list.html +36 -0
  18. data/doc/css/common.css +1 -0
  19. data/doc/css/full_list.css +53 -0
  20. data/doc/css/style.css +318 -0
  21. data/doc/file.README.html +154 -0
  22. data/doc/file_list.html +38 -0
  23. data/doc/frames.html +13 -0
  24. data/doc/index.html +154 -0
  25. data/doc/js/app.js +203 -0
  26. data/doc/js/full_list.js +149 -0
  27. data/doc/js/jquery.js +16 -0
  28. data/doc/method_list.html +467 -0
  29. data/doc/top-level-namespace.html +88 -0
  30. data/examples/async/client.rb +40 -0
  31. data/examples/async/server.rb +26 -0
  32. data/examples/callbacks/client.rb +8 -0
  33. data/examples/callbacks/server.rb +26 -0
  34. data/examples/secure/client.rb +9 -0
  35. data/examples/secure/server.rb +22 -0
  36. data/kiss.png +0 -0
  37. data/lib/marilyn-rpc/client.rb +91 -26
  38. data/lib/marilyn-rpc/gentleman.rb +4 -1
  39. data/lib/marilyn-rpc/mails.rb +1 -1
  40. data/lib/marilyn-rpc/server.rb +27 -3
  41. data/lib/marilyn-rpc/service.rb +64 -0
  42. data/lib/marilyn-rpc/service_cache.rb +13 -2
  43. data/lib/marilyn-rpc/version.rb +1 -1
  44. metadata +39 -3
@@ -0,0 +1,489 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>Module: MarilynRPC::MailHelper</title>
7
+ <link rel="stylesheet" href="../css/style.css" type="text/css" media="screen" charset="utf-8" />
8
+ <link rel="stylesheet" href="../css/common.css" type="text/css" media="screen" charset="utf-8" />
9
+
10
+ <script type="text/javascript" charset="utf-8">
11
+ relpath = '..';
12
+ if (relpath != '') relpath += '/';
13
+ </script>
14
+ <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
15
+ <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
16
+
17
+ </head>
18
+ <body>
19
+ <script type="text/javascript" charset="utf-8">
20
+ if (window.top.frames.main) document.body.className = 'frames';
21
+ </script>
22
+
23
+ <div id="header">
24
+ <div id="menu">
25
+
26
+ <a href="../_index.html">Index (M)</a> &raquo;
27
+ <span class='title'><span class='object_link'><a href="../MarilynRPC.html" title="MarilynRPC (module)">MarilynRPC</a></span></span>
28
+ &raquo;
29
+ <span class="title">MailHelper</span>
30
+
31
+
32
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
33
+ </div>
34
+
35
+ <div id="search">
36
+ <a id="class_list_link" href="#">Class List</a>
37
+ <a id="method_list_link" href="#">Method List</a>
38
+ <a id ="file_list_link" href="#">File List</a>
39
+ </div>
40
+
41
+ <div class="clear"></div>
42
+ </div>
43
+
44
+ <iframe id="search_frame"></iframe>
45
+
46
+ <div id="content"><h1>Module: MarilynRPC::MailHelper
47
+
48
+
49
+
50
+ </h1>
51
+
52
+ <dl class="box">
53
+
54
+
55
+
56
+
57
+
58
+
59
+
60
+ <dt class="r1">Included in:</dt>
61
+ <dd class="r1"><span class='object_link'><a href="CallRequestMail.html" title="MarilynRPC::CallRequestMail (class)">CallRequestMail</a></span>, <span class='object_link'><a href="CallResponseMail.html" title="MarilynRPC::CallResponseMail (class)">CallResponseMail</a></span>, <span class='object_link'><a href="ExceptionMail.html" title="MarilynRPC::ExceptionMail (class)">ExceptionMail</a></span></dd>
62
+
63
+
64
+
65
+ <dt class="r2 last">Defined in:</dt>
66
+ <dd class="r2 last">lib/marilyn-rpc/mails.rb</dd>
67
+
68
+ </dl>
69
+ <div class="clear"></div>
70
+
71
+ <h2>Overview</h2><div class="docstring">
72
+ <div class="discussion">
73
+ <p>Helper that gets mixed into the mail classes to make common things easyer</p>
74
+
75
+ </div>
76
+ </div>
77
+ <div class="tags">
78
+
79
+ </div>
80
+
81
+
82
+
83
+ <h2>
84
+ Class Method Summary
85
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
86
+ </h2>
87
+
88
+ <ul class="summary">
89
+
90
+ <li class="public ">
91
+ <span class="summary_signature">
92
+
93
+ <a href="#type-class_method" title="type (class method)">+ (Object) <strong>type</strong>(nr) </a>
94
+
95
+
96
+
97
+ </span>
98
+
99
+
100
+
101
+
102
+
103
+
104
+
105
+
106
+ <span class="summary_desc"><div class='inline'><p>generate a new serialize id which can be used in a mail.</p></div></span>
107
+
108
+ </li>
109
+
110
+
111
+ </ul>
112
+
113
+ <h2>
114
+ Instance Method Summary
115
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
116
+ </h2>
117
+
118
+ <ul class="summary">
119
+
120
+ <li class="public ">
121
+ <span class="summary_signature">
122
+
123
+ <a href="#deserialize-instance_method" title="#deserialize (instance method)">- (Object) <strong>deserialize</strong>(data) </a>
124
+
125
+
126
+
127
+ </span>
128
+
129
+
130
+
131
+
132
+
133
+
134
+
135
+
136
+ <span class="summary_desc"><div class='inline'><p>deserializes the passed data to the original objects.</p></div></span>
137
+
138
+ </li>
139
+
140
+
141
+ <li class="public ">
142
+ <span class="summary_signature">
143
+
144
+ <a href="#only_data-instance_method" title="#only_data (instance method)">- (String) <strong>only_data</strong>(data) </a>
145
+
146
+
147
+
148
+ </span>
149
+
150
+
151
+
152
+
153
+
154
+
155
+
156
+
157
+ <span class="summary_desc"><div class='inline'><p>extracts the real data and ignores the type information.</p></div></span>
158
+
159
+ </li>
160
+
161
+
162
+ <li class="public ">
163
+ <span class="summary_signature">
164
+
165
+ <a href="#serialize-instance_method" title="#serialize (instance method)">- (Object) <strong>serialize</strong>(data) </a>
166
+
167
+
168
+
169
+ </span>
170
+
171
+
172
+
173
+
174
+
175
+
176
+
177
+
178
+ <span class="summary_desc"><div class='inline'><p>serialize the data using marilyns default serializer.</p></div></span>
179
+
180
+ </li>
181
+
182
+
183
+ </ul>
184
+
185
+
186
+
187
+
188
+ <div id="class_method_details" class="method_details_list">
189
+ <h2>Class Method Details</h2>
190
+
191
+
192
+ <div class="method_details first">
193
+ <p class="signature first" id="type-class_method">
194
+
195
+ + (<tt>Object</tt>) <strong>type</strong>(nr)
196
+
197
+
198
+
199
+ </p><div class="docstring">
200
+ <div class="discussion">
201
+ <p>generate a new serialize id which can be used in a mail</p>
202
+
203
+ </div>
204
+ </div>
205
+ <div class="tags">
206
+ <h3>Parameters:</h3>
207
+ <ul class="param">
208
+
209
+ <li>
210
+
211
+ <span class='type'>(<tt>Integer</tt>)</span>
212
+
213
+
214
+ <span class='name'>a</span>
215
+
216
+
217
+
218
+ &mdash;
219
+ <div class='inline'><p>number between 0 and 254</p></div>
220
+
221
+ </li>
222
+
223
+ <li>
224
+
225
+ <span class='type'>(<tt>String</tt>)</span>
226
+
227
+
228
+ <span class='name'>returns</span>
229
+
230
+
231
+
232
+ &mdash;
233
+ <div class='inline'><p>an 1 byte string as type id</p></div>
234
+
235
+ </li>
236
+
237
+ </ul>
238
+
239
+ </div><table class="source_code">
240
+ <tr>
241
+ <td>
242
+ <pre class="lines">
243
+
244
+
245
+ 7
246
+ 8
247
+ 9</pre>
248
+ </td>
249
+ <td>
250
+ <pre class="code"><span class="info file"># File 'lib/marilyn-rpc/mails.rb', line 7</span>
251
+
252
+ <span class='def def kw'>def</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='type identifier id'>type</span><span class='lparen token'>(</span><span class='nr identifier id'>nr</span><span class='rparen token'>)</span>
253
+ <span class='lbrack token'>[</span><span class='nr identifier id'>nr</span><span class='rbrack token'>]</span><span class='dot token'>.</span><span class='pack identifier id'>pack</span><span class='lparen token'>(</span><span class='string val'>&quot;c&quot;</span><span class='rparen token'>)</span>
254
+ <span class='end end kw'>end</span>
255
+ </pre>
256
+ </td>
257
+ </tr>
258
+ </table>
259
+ </div>
260
+
261
+ </div>
262
+
263
+ <div id="instance_method_details" class="method_details_list">
264
+ <h2>Instance Method Details</h2>
265
+
266
+
267
+ <div class="method_details first">
268
+ <p class="signature first" id="deserialize-instance_method">
269
+
270
+ - (<tt>Object</tt>) <strong>deserialize</strong>(data)
271
+
272
+
273
+
274
+ </p><div class="docstring">
275
+ <div class="discussion">
276
+ <p>deserializes the passed data to the original objects</p>
277
+
278
+ </div>
279
+ </div>
280
+ <div class="tags">
281
+ <h3>Parameters:</h3>
282
+ <ul class="param">
283
+
284
+ <li>
285
+
286
+ <span class='type'>(<tt>String</tt>)</span>
287
+
288
+
289
+ <span class='name'>data</span>
290
+
291
+
292
+
293
+ &mdash;
294
+ <div class='inline'><p>the serialized data</p></div>
295
+
296
+ </li>
297
+
298
+ </ul>
299
+ <h3>Returns:</h3>
300
+ <ul class="return">
301
+
302
+ <li>
303
+
304
+ <span class='type'>(<tt>Object</tt>)</span>
305
+
306
+
307
+
308
+
309
+ &mdash;
310
+ <div class='inline'><p>the deserialized object</p></div>
311
+
312
+ </li>
313
+
314
+ </ul>
315
+
316
+ </div><table class="source_code">
317
+ <tr>
318
+ <td>
319
+ <pre class="lines">
320
+
321
+
322
+ 28
323
+ 29
324
+ 30</pre>
325
+ </td>
326
+ <td>
327
+ <pre class="code"><span class="info file"># File 'lib/marilyn-rpc/mails.rb', line 28</span>
328
+
329
+ <span class='def def kw'>def</span> <span class='deserialize identifier id'>deserialize</span><span class='lparen token'>(</span><span class='data identifier id'>data</span><span class='rparen token'>)</span>
330
+ <span class='Marshal constant id'>Marshal</span><span class='dot token'>.</span><span class='load identifier id'>load</span><span class='lparen token'>(</span><span class='data identifier id'>data</span><span class='rparen token'>)</span>
331
+ <span class='end end kw'>end</span>
332
+ </pre>
333
+ </td>
334
+ </tr>
335
+ </table>
336
+ </div>
337
+
338
+ <div class="method_details ">
339
+ <p class="signature " id="only_data-instance_method">
340
+
341
+ - (<tt>String</tt>) <strong>only_data</strong>(data)
342
+
343
+
344
+
345
+ </p><div class="docstring">
346
+ <div class="discussion">
347
+ <p>extracts the real data and ignores the type information</p>
348
+
349
+ </div>
350
+ </div>
351
+ <div class="tags">
352
+ <h3>Parameters:</h3>
353
+ <ul class="param">
354
+
355
+ <li>
356
+
357
+ <span class='type'>(<tt>String</tt>)</span>
358
+
359
+
360
+ <span class='name'>data</span>
361
+
362
+
363
+
364
+ &mdash;
365
+ <div class='inline'><p>the data to extract the mail from</p></div>
366
+
367
+ </li>
368
+
369
+ </ul>
370
+ <h3>Returns:</h3>
371
+ <ul class="return">
372
+
373
+ <li>
374
+
375
+ <span class='type'>(<tt>String</tt>)</span>
376
+
377
+
378
+
379
+
380
+ &mdash;
381
+ <div class='inline'><p>the extracted data</p></div>
382
+
383
+ </li>
384
+
385
+ </ul>
386
+
387
+ </div><table class="source_code">
388
+ <tr>
389
+ <td>
390
+ <pre class="lines">
391
+
392
+
393
+ 14
394
+ 15
395
+ 16</pre>
396
+ </td>
397
+ <td>
398
+ <pre class="code"><span class="info file"># File 'lib/marilyn-rpc/mails.rb', line 14</span>
399
+
400
+ <span class='def def kw'>def</span> <span class='only_data identifier id'>only_data</span><span class='lparen token'>(</span><span class='data identifier id'>data</span><span class='rparen token'>)</span>
401
+ <span class='data identifier id'>data</span><span class='dot token'>.</span><span class='slice identifier id'>slice</span><span class='lparen token'>(</span><span class='integer val'>1</span><span class='comma token'>,</span> <span class='data identifier id'>data</span><span class='dot token'>.</span><span class='size identifier id'>size</span><span class='rparen token'>)</span>
402
+ <span class='end end kw'>end</span>
403
+ </pre>
404
+ </td>
405
+ </tr>
406
+ </table>
407
+ </div>
408
+
409
+ <div class="method_details ">
410
+ <p class="signature " id="serialize-instance_method">
411
+
412
+ - (<tt>Object</tt>) <strong>serialize</strong>(data)
413
+
414
+
415
+
416
+ </p><div class="docstring">
417
+ <div class="discussion">
418
+ <p>serialize the data using marilyns default serializer</p>
419
+
420
+ </div>
421
+ </div>
422
+ <div class="tags">
423
+ <h3>Parameters:</h3>
424
+ <ul class="param">
425
+
426
+ <li>
427
+
428
+ <span class='type'>(<tt>Object</tt>)</span>
429
+
430
+
431
+ <span class='name'>data</span>
432
+
433
+
434
+
435
+ &mdash;
436
+ <div class='inline'><p>the data to encode</p></div>
437
+
438
+ </li>
439
+
440
+ <li>
441
+
442
+ <span class='type'>(<tt>String</tt>)</span>
443
+
444
+
445
+ <span class='name'>the</span>
446
+
447
+
448
+
449
+ &mdash;
450
+ <div class='inline'><p>serialized data</p></div>
451
+
452
+ </li>
453
+
454
+ </ul>
455
+
456
+ </div><table class="source_code">
457
+ <tr>
458
+ <td>
459
+ <pre class="lines">
460
+
461
+
462
+ 21
463
+ 22
464
+ 23</pre>
465
+ </td>
466
+ <td>
467
+ <pre class="code"><span class="info file"># File 'lib/marilyn-rpc/mails.rb', line 21</span>
468
+
469
+ <span class='def def kw'>def</span> <span class='serialize identifier id'>serialize</span><span class='lparen token'>(</span><span class='data identifier id'>data</span><span class='rparen token'>)</span>
470
+ <span class='Marshal constant id'>Marshal</span><span class='dot token'>.</span><span class='dump identifier id'>dump</span><span class='lparen token'>(</span><span class='data identifier id'>data</span><span class='rparen token'>)</span>
471
+ <span class='end end kw'>end</span>
472
+ </pre>
473
+ </td>
474
+ </tr>
475
+ </table>
476
+ </div>
477
+
478
+ </div>
479
+
480
+ </div>
481
+
482
+ <div id="footer">
483
+ Generated on Wed Jun 8 18:26:47 2011 by
484
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
485
+ 0.6.8 (ruby-1.8.7).
486
+ </div>
487
+
488
+ </body>
489
+ </html>