marilyn-rpc 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. data/benchmark/client.rb +42 -14
  2. data/doc/MarilynRPC.html +108 -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/_index.html +219 -0
  16. data/doc/class_list.html +36 -0
  17. data/doc/css/common.css +1 -0
  18. data/doc/css/full_list.css +53 -0
  19. data/doc/css/style.css +318 -0
  20. data/doc/file.README.html +154 -0
  21. data/doc/file_list.html +38 -0
  22. data/doc/frames.html +13 -0
  23. data/doc/index.html +154 -0
  24. data/doc/js/app.js +203 -0
  25. data/doc/js/full_list.js +149 -0
  26. data/doc/js/jquery.js +16 -0
  27. data/doc/method_list.html +467 -0
  28. data/doc/top-level-namespace.html +88 -0
  29. data/lib/marilyn-rpc/client.rb +20 -21
  30. data/lib/marilyn-rpc/envelope.rb +27 -10
  31. data/lib/marilyn-rpc/gentleman.rb +8 -1
  32. data/lib/marilyn-rpc/mails.rb +40 -55
  33. data/lib/marilyn-rpc/server.rb +4 -11
  34. data/lib/marilyn-rpc/service.rb +1 -1
  35. data/lib/marilyn-rpc/service_cache.rb +7 -4
  36. data/lib/marilyn-rpc/version.rb +1 -1
  37. data/marilyn-rpc-0.0.2.gem +0 -0
  38. data/spec/envelope_spec.rb +18 -9
  39. data/spec/gentleman_spec.rb +14 -3
  40. data/spec/mails_spec.rb +2 -1
  41. data/spec/server_spec.rb +4 -4
  42. data/spec/service_cache_spec.rb +8 -0
  43. data/spec/spec_helper.rb +9 -2
  44. metadata +30 -22
@@ -0,0 +1,418 @@
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>Class: MarilynRPC::CallResponseMail</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 (C)</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">CallResponseMail</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>Class: MarilynRPC::CallResponseMail
47
+
48
+
49
+
50
+ </h1>
51
+
52
+ <dl class="box">
53
+
54
+ <dt class="r1">Inherits:</dt>
55
+ <dd class="r1">
56
+ <span class="inheritName">Struct</span>
57
+
58
+ <ul class="fullTree">
59
+ <li>Object</li>
60
+
61
+ <li class="next">Struct</li>
62
+
63
+ <li class="next">MarilynRPC::CallResponseMail</li>
64
+
65
+ </ul>
66
+ <a href="#" class="inheritanceTree">show all</a>
67
+
68
+ </dd>
69
+
70
+
71
+
72
+
73
+
74
+
75
+ <dt class="r2">Includes:</dt>
76
+ <dd class="r2"><span class='object_link'><a href="MailHelper.html" title="MarilynRPC::MailHelper (module)">MailHelper</a></span></dd>
77
+
78
+
79
+
80
+
81
+
82
+ <dt class="r1 last">Defined in:</dt>
83
+ <dd class="r1 last">lib/marilyn-rpc/mails.rb</dd>
84
+
85
+ </dl>
86
+ <div class="clear"></div>
87
+
88
+
89
+ <h2>Constant Summary</h2>
90
+
91
+ <dl class="constants">
92
+
93
+ <dt id="TYPE-constant" class="">TYPE =
94
+
95
+ </dt>
96
+ <dd><pre class="code"><span class='MarilynRPC constant id'>MarilynRPC</span><span class='colon2 op'>::</span><span class='MailHelper constant id'>MailHelper</span><span class='dot token'>.</span><span class='type identifier id'>type</span><span class='lparen token'>(</span><span class='integer val'>2</span><span class='rparen token'>)</span>
97
+ </pre></dd>
98
+
99
+ </dl>
100
+
101
+
102
+
103
+
104
+
105
+
106
+
107
+
108
+ <h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
109
+ <ul class="summary">
110
+
111
+ <li class="public ">
112
+ <span class="summary_signature">
113
+
114
+ <a href="#result-instance_method" title="#result (instance method)">- (Object) <strong>result</strong> </a>
115
+
116
+
117
+
118
+ </span>
119
+
120
+
121
+
122
+
123
+
124
+
125
+
126
+
127
+
128
+
129
+
130
+ <span class="summary_desc"><div class='inline'><p>Returns the value of attribute result.</p></div></span>
131
+
132
+ </li>
133
+
134
+
135
+ <li class="public ">
136
+ <span class="summary_signature">
137
+
138
+ <a href="#tag-instance_method" title="#tag (instance method)">- (Object) <strong>tag</strong> </a>
139
+
140
+
141
+
142
+ </span>
143
+
144
+
145
+
146
+
147
+
148
+
149
+
150
+
151
+
152
+
153
+
154
+ <span class="summary_desc"><div class='inline'><p>Returns the value of attribute tag.</p></div></span>
155
+
156
+ </li>
157
+
158
+
159
+ </ul>
160
+
161
+
162
+
163
+ <h2>
164
+ Instance Method Summary
165
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
166
+ </h2>
167
+
168
+ <ul class="summary">
169
+
170
+ <li class="public ">
171
+ <span class="summary_signature">
172
+
173
+ <a href="#decode-instance_method" title="#decode (instance method)">- (Object) <strong>decode</strong>(data) </a>
174
+
175
+
176
+
177
+ </span>
178
+
179
+
180
+
181
+
182
+
183
+
184
+
185
+
186
+ <span class="summary_desc"><div class='inline'></div></span>
187
+
188
+ </li>
189
+
190
+
191
+ <li class="public ">
192
+ <span class="summary_signature">
193
+
194
+ <a href="#encode-instance_method" title="#encode (instance method)">- (Object) <strong>encode</strong> </a>
195
+
196
+
197
+
198
+ </span>
199
+
200
+
201
+
202
+
203
+
204
+
205
+
206
+
207
+ <span class="summary_desc"><div class='inline'></div></span>
208
+
209
+ </li>
210
+
211
+
212
+ </ul>
213
+
214
+
215
+
216
+
217
+
218
+
219
+
220
+
221
+
222
+
223
+ <h3 class="inherited">Methods included from <span class='object_link'><a href="MailHelper.html" title="MarilynRPC::MailHelper (module)">MailHelper</a></span></h3>
224
+ <p class="inherited"><span class='object_link'><a href="MailHelper.html#deserialize-instance_method" title="MarilynRPC::MailHelper#deserialize (method)">#deserialize</a></span>, <span class='object_link'><a href="MailHelper.html#only_data-instance_method" title="MarilynRPC::MailHelper#only_data (method)">#only_data</a></span>, <span class='object_link'><a href="MailHelper.html#serialize-instance_method" title="MarilynRPC::MailHelper#serialize (method)">#serialize</a></span>, <span class='object_link'><a href="MailHelper.html#type-class_method" title="MarilynRPC::MailHelper.type (method)">type</a></span></p>
225
+
226
+
227
+ <div id="instance_attr_details" class="attr_details">
228
+ <h2>Instance Attribute Details</h2>
229
+
230
+
231
+ <span id="result=-instance_method"></span>
232
+ <span id="result-instance_method"></span>
233
+ <div class="method_details first">
234
+ <p class="signature first" id="result-instance_method">
235
+
236
+ - (<tt>Object</tt>) <strong>result</strong>
237
+
238
+
239
+
240
+ </p><div class="docstring">
241
+ <div class="discussion">
242
+ <p>Returns the value of attribute result</p>
243
+
244
+ </div>
245
+ </div>
246
+ <div class="tags">
247
+ <h3>Returns:</h3>
248
+ <ul class="return">
249
+
250
+ <li>
251
+
252
+ <span class='type'>(<tt>Object</tt>)</span>
253
+
254
+
255
+
256
+
257
+ &mdash;
258
+ <div class='inline'><p>the current value of result</p></div>
259
+
260
+ </li>
261
+
262
+ </ul>
263
+
264
+ </div><table class="source_code">
265
+ <tr>
266
+ <td>
267
+ <pre class="lines">
268
+
269
+
270
+ 46
271
+ 47
272
+ 48</pre>
273
+ </td>
274
+ <td>
275
+ <pre class="code"><span class="info file"># File 'lib/marilyn-rpc/mails.rb', line 46</span>
276
+
277
+ <span class='def def kw'>def</span> <span class='result identifier id'>result</span>
278
+ <span class='@result ivar id'>@result</span>
279
+ <span class='end end kw'>end</span>
280
+ </pre>
281
+ </td>
282
+ </tr>
283
+ </table>
284
+ </div>
285
+
286
+
287
+ <span id="tag=-instance_method"></span>
288
+ <span id="tag-instance_method"></span>
289
+ <div class="method_details ">
290
+ <p class="signature " id="tag-instance_method">
291
+
292
+ - (<tt>Object</tt>) <strong>tag</strong>
293
+
294
+
295
+
296
+ </p><div class="docstring">
297
+ <div class="discussion">
298
+ <p>Returns the value of attribute tag</p>
299
+
300
+ </div>
301
+ </div>
302
+ <div class="tags">
303
+ <h3>Returns:</h3>
304
+ <ul class="return">
305
+
306
+ <li>
307
+
308
+ <span class='type'>(<tt>Object</tt>)</span>
309
+
310
+
311
+
312
+
313
+ &mdash;
314
+ <div class='inline'><p>the current value of tag</p></div>
315
+
316
+ </li>
317
+
318
+ </ul>
319
+
320
+ </div><table class="source_code">
321
+ <tr>
322
+ <td>
323
+ <pre class="lines">
324
+
325
+
326
+ 46
327
+ 47
328
+ 48</pre>
329
+ </td>
330
+ <td>
331
+ <pre class="code"><span class="info file"># File 'lib/marilyn-rpc/mails.rb', line 46</span>
332
+
333
+ <span class='def def kw'>def</span> <span class='tag identifier id'>tag</span>
334
+ <span class='@tag ivar id'>@tag</span>
335
+ <span class='end end kw'>end</span>
336
+ </pre>
337
+ </td>
338
+ </tr>
339
+ </table>
340
+ </div>
341
+
342
+ </div>
343
+
344
+
345
+ <div id="instance_method_details" class="method_details_list">
346
+ <h2>Instance Method Details</h2>
347
+
348
+
349
+ <div class="method_details first">
350
+ <p class="signature first" id="decode-instance_method">
351
+
352
+ - (<tt>Object</tt>) <strong>decode</strong>(data)
353
+
354
+
355
+
356
+ </p><table class="source_code">
357
+ <tr>
358
+ <td>
359
+ <pre class="lines">
360
+
361
+
362
+ 54
363
+ 55
364
+ 56</pre>
365
+ </td>
366
+ <td>
367
+ <pre class="code"><span class="info file"># File 'lib/marilyn-rpc/mails.rb', line 54</span>
368
+
369
+ <span class='def def kw'>def</span> <span class='decode identifier id'>decode</span><span class='lparen token'>(</span><span class='data identifier id'>data</span><span class='rparen token'>)</span>
370
+ <span class='self self kw'>self</span><span class='dot token'>.</span><span class='tag identifier id'>tag</span><span class='comma token'>,</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='result identifier id'>result</span> <span class='assign token'>=</span> <span class='deserialize identifier id'>deserialize</span><span class='lparen token'>(</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><span class='rparen token'>)</span>
371
+ <span class='end end kw'>end</span>
372
+ </pre>
373
+ </td>
374
+ </tr>
375
+ </table>
376
+ </div>
377
+
378
+ <div class="method_details ">
379
+ <p class="signature " id="encode-instance_method">
380
+
381
+ - (<tt>Object</tt>) <strong>encode</strong>
382
+
383
+
384
+
385
+ </p><table class="source_code">
386
+ <tr>
387
+ <td>
388
+ <pre class="lines">
389
+
390
+
391
+ 50
392
+ 51
393
+ 52</pre>
394
+ </td>
395
+ <td>
396
+ <pre class="code"><span class="info file"># File 'lib/marilyn-rpc/mails.rb', line 50</span>
397
+
398
+ <span class='def def kw'>def</span> <span class='encode identifier id'>encode</span>
399
+ <span class='TYPE constant id'>TYPE</span> <span class='plus op'>+</span> <span class='serialize identifier id'>serialize</span><span class='lparen token'>(</span><span class='lbrack token'>[</span><span class='self self kw'>self</span><span class='dot token'>.</span><span class='tag identifier id'>tag</span><span class='comma token'>,</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='result identifier id'>result</span><span class='rbrack token'>]</span><span class='rparen token'>)</span>
400
+ <span class='end end kw'>end</span>
401
+ </pre>
402
+ </td>
403
+ </tr>
404
+ </table>
405
+ </div>
406
+
407
+ </div>
408
+
409
+ </div>
410
+
411
+ <div id="footer">
412
+ Generated on Wed Jun 8 18:26:46 2011 by
413
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
414
+ 0.6.8 (ruby-1.8.7).
415
+ </div>
416
+
417
+ </body>
418
+ </html>
@@ -0,0 +1,705 @@
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>Class: MarilynRPC::Envelope</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 (E)</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">Envelope</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>Class: MarilynRPC::Envelope
47
+
48
+
49
+
50
+ </h1>
51
+
52
+ <dl class="box">
53
+
54
+ <dt class="r1">Inherits:</dt>
55
+ <dd class="r1">
56
+ <span class="inheritName">Object</span>
57
+
58
+ <ul class="fullTree">
59
+ <li>Object</li>
60
+
61
+ <li class="next">MarilynRPC::Envelope</li>
62
+
63
+ </ul>
64
+ <a href="#" class="inheritanceTree">show all</a>
65
+
66
+ </dd>
67
+
68
+
69
+
70
+
71
+
72
+
73
+
74
+
75
+
76
+ <dt class="r2 last">Defined in:</dt>
77
+ <dd class="r2 last">lib/marilyn-rpc/envelope.rb</dd>
78
+
79
+ </dl>
80
+ <div class="clear"></div>
81
+
82
+ <h2>Overview</h2><div class="docstring">
83
+ <div class="discussion">
84
+ <p>This class handles the envelope parsing and encoding which will be used by the server to handle multiple writes into the envelope.</p>
85
+
86
+ </div>
87
+ </div>
88
+ <div class="tags">
89
+
90
+ </div>
91
+
92
+ <h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
93
+ <ul class="summary">
94
+
95
+ <li class="public ">
96
+ <span class="summary_signature">
97
+
98
+ <a href="#size-instance_method" title="#size (instance method)">- (Object) <strong>size</strong> </a>
99
+
100
+
101
+
102
+ </span>
103
+
104
+
105
+ <span class="note title readonly">readonly</span>
106
+
107
+
108
+
109
+
110
+
111
+
112
+
113
+
114
+ <span class="summary_desc"><div class='inline'><p>size of the envelope content.</p></div></span>
115
+
116
+ </li>
117
+
118
+
119
+ </ul>
120
+
121
+
122
+
123
+ <h2>
124
+ Instance Method Summary
125
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
126
+ </h2>
127
+
128
+ <ul class="summary">
129
+
130
+ <li class="public ">
131
+ <span class="summary_signature">
132
+
133
+ <a href="#content-instance_method" title="#content (instance method)">- (String) <strong>content</strong> </a>
134
+
135
+
136
+
137
+ </span>
138
+
139
+
140
+
141
+
142
+
143
+
144
+
145
+
146
+ <span class="summary_desc"><div class='inline'><p>returns the content of the envelope.</p></div></span>
147
+
148
+ </li>
149
+
150
+
151
+ <li class="public ">
152
+ <span class="summary_signature">
153
+
154
+ <a href="#content%3D-instance_method" title="#content= (instance method)">- (Object) <strong>content=</strong>(content) </a>
155
+
156
+
157
+
158
+ </span>
159
+
160
+
161
+
162
+
163
+
164
+
165
+
166
+
167
+ <span class="summary_desc"><div class='inline'><p>sets the content of the envelope.</p></div></span>
168
+
169
+ </li>
170
+
171
+
172
+ <li class="public ">
173
+ <span class="summary_signature">
174
+
175
+ <a href="#encode-instance_method" title="#encode (instance method)">- (String) <strong>encode</strong> </a>
176
+
177
+
178
+
179
+ </span>
180
+
181
+
182
+
183
+
184
+
185
+
186
+
187
+
188
+ <span class="summary_desc"><div class='inline'><p>encodes the envelope to be send over the wire.</p></div></span>
189
+
190
+ </li>
191
+
192
+
193
+ <li class="public ">
194
+ <span class="summary_signature">
195
+
196
+ <a href="#finished%3F-instance_method" title="#finished? (instance method)">- (Boolean) <strong>finished?</strong> </a>
197
+
198
+
199
+
200
+ </span>
201
+
202
+
203
+
204
+
205
+
206
+
207
+
208
+
209
+ <span class="summary_desc"><div class='inline'><p>checks if the complete envelope was allready parsed.</p></div></span>
210
+
211
+ </li>
212
+
213
+
214
+ <li class="public ">
215
+ <span class="summary_signature">
216
+
217
+ <a href="#initialize-instance_method" title="#initialize (instance method)">- (Envelope) <strong>initialize</strong>(content = nil) </a>
218
+
219
+
220
+
221
+ </span>
222
+
223
+ <span class="note title constructor">constructor</span>
224
+
225
+
226
+
227
+
228
+
229
+
230
+
231
+
232
+ <span class="summary_desc"><div class='inline'><p>create a new envelope instance.</p></div></span>
233
+
234
+ </li>
235
+
236
+
237
+ <li class="public ">
238
+ <span class="summary_signature">
239
+
240
+ <a href="#parse%21-instance_method" title="#parse! (instance method)">- (String<sup>?</sup>) <strong>parse!</strong>(data) </a>
241
+
242
+
243
+
244
+ </span>
245
+
246
+
247
+
248
+
249
+
250
+
251
+
252
+
253
+ <span class="summary_desc"><div class='inline'><p>parses the passed data.</p></div></span>
254
+
255
+ </li>
256
+
257
+
258
+ </ul>
259
+
260
+
261
+ <div id="constructor_details" class="method_details_list">
262
+ <h2>Constructor Details</h2>
263
+
264
+ <div class="method_details first">
265
+ <p class="signature first" id="initialize-instance_method">
266
+
267
+ - (<tt><span class='object_link'><a href="" title="MarilynRPC::Envelope (class)">Envelope</a></span></tt>) <strong>initialize</strong>(content = nil)
268
+
269
+
270
+
271
+ </p><div class="docstring">
272
+ <div class="discussion">
273
+ <p>create a new envelope instance</p>
274
+
275
+ </div>
276
+ </div>
277
+ <div class="tags">
278
+ <h3>Parameters:</h3>
279
+ <ul class="param">
280
+
281
+ <li>
282
+
283
+ <span class='type'>(<tt>String</tt>)</span>
284
+
285
+
286
+ <span class='name'>content</span>
287
+
288
+
289
+ <em class="default">(defaults to: <tt>nil</tt>)</em>
290
+
291
+
292
+ &mdash;
293
+ <div class='inline'><p>the content of the new envelope</p></div>
294
+
295
+ </li>
296
+
297
+ </ul>
298
+
299
+ </div><table class="source_code">
300
+ <tr>
301
+ <td>
302
+ <pre class="lines">
303
+
304
+
305
+ 9
306
+ 10
307
+ 11</pre>
308
+ </td>
309
+ <td>
310
+ <pre class="code"><span class="info file"># File 'lib/marilyn-rpc/envelope.rb', line 9</span>
311
+
312
+ <span class='def def kw'>def</span> <span class='initialize identifier id'>initialize</span><span class='lparen token'>(</span><span class='content identifier id'>content</span> <span class='assign token'>=</span> <span class='nil nil kw'>nil</span><span class='rparen token'>)</span>
313
+ <span class='self self kw'>self</span><span class='dot token'>.</span><span class='content identifier id'>content</span> <span class='assign token'>=</span> <span class='content identifier id'>content</span>
314
+ <span class='end end kw'>end</span>
315
+ </pre>
316
+ </td>
317
+ </tr>
318
+ </table>
319
+ </div>
320
+
321
+ </div>
322
+
323
+ <div id="instance_attr_details" class="attr_details">
324
+ <h2>Instance Attribute Details</h2>
325
+
326
+
327
+ <span id=""></span>
328
+ <span id="size-instance_method"></span>
329
+ <div class="method_details first">
330
+ <p class="signature first" id="size-instance_method">
331
+
332
+ - (<tt>Object</tt>) <strong>size</strong> <span class="extras">(readonly)</span>
333
+
334
+
335
+
336
+ </p><div class="docstring">
337
+ <div class="discussion">
338
+ <p>size of the envelope content</p>
339
+
340
+ </div>
341
+ </div>
342
+ <div class="tags">
343
+
344
+ </div><table class="source_code">
345
+ <tr>
346
+ <td>
347
+ <pre class="lines">
348
+
349
+
350
+ 5
351
+ 6
352
+ 7</pre>
353
+ </td>
354
+ <td>
355
+ <pre class="code"><span class="info file"># File 'lib/marilyn-rpc/envelope.rb', line 5</span>
356
+
357
+ <span class='def def kw'>def</span> <span class='size identifier id'>size</span>
358
+ <span class='@size ivar id'>@size</span>
359
+ <span class='end end kw'>end</span>
360
+ </pre>
361
+ </td>
362
+ </tr>
363
+ </table>
364
+ </div>
365
+
366
+ </div>
367
+
368
+
369
+ <div id="instance_method_details" class="method_details_list">
370
+ <h2>Instance Method Details</h2>
371
+
372
+
373
+ <div class="method_details first">
374
+ <p class="signature first" id="content-instance_method">
375
+
376
+ - (<tt>String</tt>) <strong>content</strong>
377
+
378
+
379
+
380
+ </p><div class="docstring">
381
+ <div class="discussion">
382
+
383
+ <div class="note notetag">
384
+ <strong>Note:</strong>
385
+ <div class='inline'><p>should only be requested when the message if finished?.</p></div>
386
+ </div>
387
+
388
+ <p>returns the content of the envelope</p>
389
+
390
+ </div>
391
+ </div>
392
+ <div class="tags">
393
+ <h3>Returns:</h3>
394
+ <ul class="return">
395
+
396
+ <li>
397
+
398
+ <span class='type'>(<tt>String</tt>)</span>
399
+
400
+
401
+
402
+
403
+ &mdash;
404
+ <div class='inline'><p>the content of the envelope</p></div>
405
+
406
+ </li>
407
+
408
+ </ul>
409
+
410
+ </div><table class="source_code">
411
+ <tr>
412
+ <td>
413
+ <pre class="lines">
414
+
415
+
416
+ 39
417
+ 40
418
+ 41</pre>
419
+ </td>
420
+ <td>
421
+ <pre class="code"><span class="info file"># File 'lib/marilyn-rpc/envelope.rb', line 39</span>
422
+
423
+ <span class='def def kw'>def</span> <span class='content identifier id'>content</span>
424
+ <span class='@buffer ivar id'>@buffer</span>
425
+ <span class='end end kw'>end</span>
426
+ </pre>
427
+ </td>
428
+ </tr>
429
+ </table>
430
+ </div>
431
+
432
+ <div class="method_details ">
433
+ <p class="signature " id="content=-instance_method">
434
+
435
+ - (<tt>Object</tt>) <strong>content=</strong>(content)
436
+
437
+
438
+
439
+ </p><div class="docstring">
440
+ <div class="discussion">
441
+ <p>sets the content of the envelope. If <code>nil</code> was passed an empty string will be set.</p>
442
+
443
+ </div>
444
+ </div>
445
+ <div class="tags">
446
+ <h3>Parameters:</h3>
447
+ <ul class="param">
448
+
449
+ <li>
450
+
451
+ <span class='type'>(<tt>String</tt>)</span>
452
+
453
+
454
+ <span class='name'>data</span>
455
+
456
+
457
+
458
+ &mdash;
459
+ <div class='inline'><p>the new content</p></div>
460
+
461
+ </li>
462
+
463
+ </ul>
464
+
465
+ </div><table class="source_code">
466
+ <tr>
467
+ <td>
468
+ <pre class="lines">
469
+
470
+
471
+ 46
472
+ 47
473
+ 48
474
+ 49</pre>
475
+ </td>
476
+ <td>
477
+ <pre class="code"><span class="info file"># File 'lib/marilyn-rpc/envelope.rb', line 46</span>
478
+
479
+ <span class='def def kw'>def</span> <span class='content= identifier id'>content=</span><span class='lparen token'>(</span><span class='content identifier id'>content</span><span class='rparen token'>)</span>
480
+ <span class='@buffer ivar id'>@buffer</span> <span class='assign token'>=</span> <span class='content identifier id'>content</span> <span class='orop op'>||</span> <span class='string val'>&quot;&quot;</span>
481
+ <span class='@size ivar id'>@size</span> <span class='assign token'>=</span> <span class='content identifier id'>content</span><span class='dot token'>.</span><span class='nil? fid id'>nil?</span> <span class='integer val'>? </span><span class='nil nil kw'>nil</span> <span class='colon op'>:</span> <span class='content identifier id'>content</span><span class='dot token'>.</span><span class='size identifier id'>size</span>
482
+ <span class='end end kw'>end</span>
483
+ </pre>
484
+ </td>
485
+ </tr>
486
+ </table>
487
+ </div>
488
+
489
+ <div class="method_details ">
490
+ <p class="signature " id="encode-instance_method">
491
+
492
+ - (<tt>String</tt>) <strong>encode</strong>
493
+
494
+
495
+
496
+ </p><div class="docstring">
497
+ <div class="discussion">
498
+ <p>encodes the envelope to be send over the wire</p>
499
+
500
+ </div>
501
+ </div>
502
+ <div class="tags">
503
+ <h3>Returns:</h3>
504
+ <ul class="return">
505
+
506
+ <li>
507
+
508
+ <span class='type'>(<tt>String</tt>)</span>
509
+
510
+
511
+
512
+
513
+ &mdash;
514
+ <div class='inline'><p>encoded envelope</p></div>
515
+
516
+ </li>
517
+
518
+ </ul>
519
+
520
+ </div><table class="source_code">
521
+ <tr>
522
+ <td>
523
+ <pre class="lines">
524
+
525
+
526
+ 53
527
+ 54
528
+ 55</pre>
529
+ </td>
530
+ <td>
531
+ <pre class="code"><span class="info file"># File 'lib/marilyn-rpc/envelope.rb', line 53</span>
532
+
533
+ <span class='def def kw'>def</span> <span class='encode identifier id'>encode</span>
534
+ <span class='lbrack token'>[</span><span class='@size ivar id'>@size</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;N&quot;</span><span class='rparen token'>)</span> <span class='plus op'>+</span> <span class='@buffer ivar id'>@buffer</span>
535
+ <span class='end end kw'>end</span>
536
+ </pre>
537
+ </td>
538
+ </tr>
539
+ </table>
540
+ </div>
541
+
542
+ <div class="method_details ">
543
+ <p class="signature " id="finished?-instance_method">
544
+
545
+ - (<tt>Boolean</tt>) <strong>finished?</strong>
546
+
547
+
548
+
549
+ </p><div class="docstring">
550
+ <div class="discussion">
551
+ <p>checks if the complete envelope was allready parsed</p>
552
+
553
+ </div>
554
+ </div>
555
+ <div class="tags">
556
+ <h3>Returns:</h3>
557
+ <ul class="return">
558
+
559
+ <li>
560
+
561
+ <span class='type'>(<tt>Boolean</tt>)</span>
562
+
563
+
564
+
565
+
566
+ &mdash;
567
+ <div class='inline'><p><code>true</code> if the message was parsed</p></div>
568
+
569
+ </li>
570
+
571
+ </ul>
572
+
573
+ </div><table class="source_code">
574
+ <tr>
575
+ <td>
576
+ <pre class="lines">
577
+
578
+
579
+ 59
580
+ 60
581
+ 61</pre>
582
+ </td>
583
+ <td>
584
+ <pre class="code"><span class="info file"># File 'lib/marilyn-rpc/envelope.rb', line 59</span>
585
+
586
+ <span class='def def kw'>def</span> <span class='finished? fid id'>finished?</span>
587
+ <span class='@buffer ivar id'>@buffer</span><span class='dot token'>.</span><span class='size identifier id'>size</span> <span class='eq op'>==</span> <span class='@size ivar id'>@size</span>
588
+ <span class='end end kw'>end</span>
589
+ </pre>
590
+ </td>
591
+ </tr>
592
+ </table>
593
+ </div>
594
+
595
+ <div class="method_details ">
596
+ <p class="signature " id="parse!-instance_method">
597
+
598
+ - (<tt>String</tt><sup>?</sup>) <strong>parse!</strong>(data)
599
+
600
+
601
+
602
+ </p><div class="docstring">
603
+ <div class="discussion">
604
+ <p>parses the passed data</p>
605
+
606
+ </div>
607
+ </div>
608
+ <div class="tags">
609
+ <h3>Parameters:</h3>
610
+ <ul class="param">
611
+
612
+ <li>
613
+
614
+ <span class='type'>(<tt>String</tt>)</span>
615
+
616
+
617
+ <span class='name'>data</span>
618
+
619
+
620
+
621
+ &mdash;
622
+ <div class='inline'><p>parses the parsed data</p></div>
623
+
624
+ </li>
625
+
626
+ </ul>
627
+ <h3>Returns:</h3>
628
+ <ul class="return">
629
+
630
+ <li>
631
+
632
+ <span class='type'>(<tt>String</tt>, <tt>nil</tt>)</span>
633
+
634
+
635
+
636
+
637
+ &mdash;
638
+ <div class='inline'><p>returns data that is not part of this string (in case the) parser gets more data than the length of the envelope. In case there are no data it will return nil.</p></div>
639
+
640
+ </li>
641
+
642
+ </ul>
643
+
644
+ </div><table class="source_code">
645
+ <tr>
646
+ <td>
647
+ <pre class="lines">
648
+
649
+
650
+ 18
651
+ 19
652
+ 20
653
+ 21
654
+ 22
655
+ 23
656
+ 24
657
+ 25
658
+ 26
659
+ 27
660
+ 28
661
+ 29
662
+ 30
663
+ 31
664
+ 32
665
+ 33
666
+ 34</pre>
667
+ </td>
668
+ <td>
669
+ <pre class="code"><span class="info file"># File 'lib/marilyn-rpc/envelope.rb', line 18</span>
670
+
671
+ <span class='def def kw'>def</span> <span class='parse! fid id'>parse!</span><span class='lparen token'>(</span><span class='data identifier id'>data</span><span class='rparen token'>)</span>
672
+ <span class='@buffer ivar id'>@buffer</span> <span class='opasgn op'>+=</span> <span class='data identifier id'>data</span>
673
+ <span class='overhang identifier id'>overhang</span> <span class='assign token'>=</span> <span class='nil nil kw'>nil</span>
674
+
675
+ <span class='comment val'># parse the length field of the </span>
676
+ <span class='if if kw'>if</span> <span class='@size ivar id'>@size</span><span class='dot token'>.</span><span class='nil? fid id'>nil?</span> <span class='andop op'>&amp;&amp;</span> <span class='@buffer ivar id'>@buffer</span><span class='dot token'>.</span><span class='size identifier id'>size</span> <span class='geq op'>&gt;=</span> <span class='integer val'>4</span>
677
+ <span class='comment val'># extract 4 bytes length header</span>
678
+ <span class='@size ivar id'>@size</span> <span class='assign token'>=</span> <span class='@buffer ivar id'>@buffer</span><span class='dot token'>.</span><span class='slice! fid id'>slice!</span><span class='lparen token'>(</span><span class='integer val'>0</span><span class='dot3 op'>...</span><span class='integer val'>4</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='unpack identifier id'>unpack</span><span class='lparen token'>(</span><span class='string val'>&quot;N&quot;</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='first identifier id'>first</span>
679
+ <span class='end end kw'>end</span>
680
+
681
+ <span class='comment val'># envelope is complete and contains overhang</span>
682
+ <span class='if if kw'>if</span> <span class='notop op'>!</span><span class='@size ivar id'>@size</span><span class='dot token'>.</span><span class='nil? fid id'>nil?</span> <span class='andop op'>&amp;&amp;</span> <span class='@buffer ivar id'>@buffer</span><span class='dot token'>.</span><span class='size identifier id'>size</span> <span class='gt op'>&gt;</span> <span class='@size ivar id'>@size</span>
683
+ <span class='overhang identifier id'>overhang</span> <span class='assign token'>=</span> <span class='@buffer ivar id'>@buffer</span><span class='dot token'>.</span><span class='slice! fid id'>slice!</span><span class='lparen token'>(</span><span class='@size ivar id'>@size</span><span class='comma token'>,</span> <span class='@buffer ivar id'>@buffer</span><span class='dot token'>.</span><span class='size identifier id'>size</span><span class='rparen token'>)</span>
684
+ <span class='end end kw'>end</span>
685
+
686
+ <span class='overhang identifier id'>overhang</span>
687
+ <span class='end end kw'>end</span>
688
+ </pre>
689
+ </td>
690
+ </tr>
691
+ </table>
692
+ </div>
693
+
694
+ </div>
695
+
696
+ </div>
697
+
698
+ <div id="footer">
699
+ Generated on Wed Jun 8 18:26:46 2011 by
700
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
701
+ 0.6.8 (ruby-1.8.7).
702
+ </div>
703
+
704
+ </body>
705
+ </html>