ionian 0.6.3 → 0.6.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +63 -0
  3. data/doc/Ionian/Extension/IO.html +1062 -599
  4. data/doc/Ionian/Extension/Socket.html +2140 -1314
  5. data/doc/Ionian/Extension.html +98 -70
  6. data/doc/Ionian/Server.html +577 -345
  7. data/doc/Ionian/Socket.html +1100 -612
  8. data/doc/Ionian.html +100 -70
  9. data/doc/_index.html +164 -0
  10. data/doc/class_list.html +54 -0
  11. data/doc/css/common.css +1 -0
  12. data/doc/css/full_list.css +57 -0
  13. data/doc/css/style.css +338 -0
  14. data/doc/file.README.html +133 -0
  15. data/doc/file.license.html +73 -0
  16. data/doc/file_list.html +59 -0
  17. data/doc/frames.html +26 -0
  18. data/doc/index.html +111 -71
  19. data/doc/js/app.js +219 -0
  20. data/doc/js/full_list.js +178 -0
  21. data/doc/js/jquery.js +4 -18
  22. data/doc/method_list.html +419 -0
  23. data/doc/top-level-namespace.html +112 -0
  24. data/lib/ionian/extension/io.rb +4 -2
  25. data/lib/ionian/socket.rb +1 -1
  26. data/license.txt +2 -0
  27. metadata +28 -54
  28. data/doc/created.rid +0 -6
  29. data/doc/fonts/Lato-Light.ttf +0 -0
  30. data/doc/fonts/Lato-LightItalic.ttf +0 -0
  31. data/doc/fonts/Lato-Regular.ttf +0 -0
  32. data/doc/fonts/Lato-RegularItalic.ttf +0 -0
  33. data/doc/fonts/SourceCodePro-Bold.ttf +0 -0
  34. data/doc/fonts/SourceCodePro-Regular.ttf +0 -0
  35. data/doc/fonts.css +0 -167
  36. data/doc/images/add.png +0 -0
  37. data/doc/images/arrow_up.png +0 -0
  38. data/doc/images/brick.png +0 -0
  39. data/doc/images/brick_link.png +0 -0
  40. data/doc/images/bug.png +0 -0
  41. data/doc/images/bullet_black.png +0 -0
  42. data/doc/images/bullet_toggle_minus.png +0 -0
  43. data/doc/images/bullet_toggle_plus.png +0 -0
  44. data/doc/images/date.png +0 -0
  45. data/doc/images/delete.png +0 -0
  46. data/doc/images/find.png +0 -0
  47. data/doc/images/loadingAnimation.gif +0 -0
  48. data/doc/images/macFFBgHack.png +0 -0
  49. data/doc/images/package.png +0 -0
  50. data/doc/images/page_green.png +0 -0
  51. data/doc/images/page_white_text.png +0 -0
  52. data/doc/images/page_white_width.png +0 -0
  53. data/doc/images/plugin.png +0 -0
  54. data/doc/images/ruby.png +0 -0
  55. data/doc/images/tag_blue.png +0 -0
  56. data/doc/images/tag_green.png +0 -0
  57. data/doc/images/transparent.png +0 -0
  58. data/doc/images/wrench.png +0 -0
  59. data/doc/images/wrench_orange.png +0 -0
  60. data/doc/images/zoom.png +0 -0
  61. data/doc/js/darkfish.js +0 -140
  62. data/doc/js/navigation.js +0 -142
  63. data/doc/js/search.js +0 -109
  64. data/doc/js/search_index.js +0 -1
  65. data/doc/js/searcher.js +0 -228
  66. data/doc/rdoc.css +0 -580
  67. data/doc/table_of_contents.html +0 -402
@@ -1,463 +1,837 @@
1
- <!DOCTYPE html>
2
-
3
- <html>
4
- <head>
5
- <meta charset="UTF-8">
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>
7
+ Module: Ionian::Extension::IO
8
+
9
+ &mdash; Documentation by YARD 0.8.7.3
10
+
11
+ </title>
6
12
 
7
- <title>module Ionian::Extension::IO - RDoc Documentation</title>
13
+ <link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
8
14
 
9
- <link href="../../fonts.css" rel="stylesheet">
10
- <link href="../../rdoc.css" rel="stylesheet">
15
+ <link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
11
16
 
12
- <script type="text/javascript">
13
- var rdoc_rel_prefix = "../../";
17
+ <script type="text/javascript" charset="utf-8">
18
+ hasFrames = window.top.frames.main ? true : false;
19
+ relpath = '../../';
20
+ framesUrl = "../../frames.html#!" + escape(window.location.href);
14
21
  </script>
15
22
 
16
- <script src="../../js/jquery.js"></script>
17
- <script src="../../js/navigation.js"></script>
18
- <script src="../../js/search_index.js"></script>
19
- <script src="../../js/search.js"></script>
20
- <script src="../../js/searcher.js"></script>
21
- <script src="../../js/darkfish.js"></script>
22
-
23
-
24
- <body id="top" role="document" class="module">
25
- <nav role="navigation">
26
- <div id="project-navigation">
27
- <div id="home-section" role="region" title="Quick navigation" class="nav-section">
28
- <h2>
29
- <a href="../../index.html" rel="home">Home</a>
30
- </h2>
31
-
32
- <div id="table-of-contents-navigation">
33
- <a href="../../table_of_contents.html#pages">Pages</a>
34
- <a href="../../table_of_contents.html#classes">Classes</a>
35
- <a href="../../table_of_contents.html#methods">Methods</a>
36
- </div>
23
+
24
+ <script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
25
+
26
+ <script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
27
+
28
+
29
+ </head>
30
+ <body>
31
+ <div id="header">
32
+ <div id="menu">
33
+
34
+ <a href="../../_index.html">Index (I)</a> &raquo;
35
+ <span class='title'><span class='object_link'><a href="../../Ionian.html" title="Ionian (module)">Ionian</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Extension.html" title="Ionian::Extension (module)">Extension</a></span></span>
36
+ &raquo;
37
+ <span class="title">IO</span>
38
+
39
+
40
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
37
41
  </div>
38
42
 
39
- <div id="search-section" role="search" class="project-section initially-hidden">
40
- <form action="#" method="get" accept-charset="utf-8">
41
- <div id="search-field-wrapper">
42
- <input id="search-field" role="combobox" aria-label="Search"
43
- aria-autocomplete="list" aria-controls="search-results"
44
- type="text" name="search" placeholder="Search" spellcheck="false"
45
- title="Type to search, Up and Down to navigate, Enter to load">
43
+ <div id="search">
44
+
45
+ <a class="full_list_link" id="class_list_link"
46
+ href="../../class_list.html">
47
+ Class List
48
+ </a>
49
+
50
+ <a class="full_list_link" id="method_list_link"
51
+ href="../../method_list.html">
52
+ Method List
53
+ </a>
54
+
55
+ <a class="full_list_link" id="file_list_link"
56
+ href="../../file_list.html">
57
+ File List
58
+ </a>
59
+
60
+ </div>
61
+ <div class="clear"></div>
46
62
  </div>
47
63
 
48
- <ul id="search-results" aria-label="Search Results"
49
- aria-busy="false" aria-expanded="false"
50
- aria-atomic="false" class="initially-hidden"></ul>
51
- </form>
52
- </div>
64
+ <iframe id="search_frame"></iframe>
65
+
66
+ <div id="content"><h1>Module: Ionian::Extension::IO
67
+
68
+
69
+
70
+ </h1>
71
+
72
+ <dl class="box">
73
+
74
+
75
+
76
+
77
+
78
+
79
+
80
+
81
+ <dt class="r1 last">Defined in:</dt>
82
+ <dd class="r1 last">lib/ionian/extension/io.rb</dd>
83
+
84
+ </dl>
85
+ <div class="clear"></div>
86
+
87
+ <h2>Overview</h2><div class="docstring">
88
+ <div class="discussion">
89
+
90
+ <p>A mixin for IO objects that allows regular expression matching and
91
+ convenient notification of received data.</p>
92
+
93
+ <p>This module was designed to be extended by instantiated objects that
94
+ implement the standard library IO class. my_socket.extend Ionian::IO</p>
95
+
53
96
 
54
97
  </div>
98
+ </div>
99
+ <div class="tags">
100
+
101
+
102
+ </div>
103
+
104
+
105
+
106
+ <h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
107
+ <ul class="summary">
108
+
109
+ <li class="public ">
110
+ <span class="summary_signature">
111
+
112
+ <a href="#ionian_timeout-instance_method" title="#ionian_timeout (instance method)">- (Object) <strong>ionian_timeout</strong> </a>
113
+
114
+
115
+
116
+ </span>
117
+
118
+
119
+
120
+
121
+
122
+
123
+
124
+
125
+
126
+
127
+
128
+
129
+ <span class="summary_desc"><div class='inline'>
130
+ <p>Number of seconds to attempt an IO operation before timing out.</p>
131
+ </div></span>
132
+
133
+ </li>
134
+
135
+
136
+ </ul>
137
+
138
+
139
+
55
140
 
56
141
 
142
+ <h2>
143
+ Class Method Summary
144
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
145
+ </h2>
57
146
 
58
- <div id="class-metadata">
147
+ <ul class="summary">
148
+
149
+ <li class="public ">
150
+ <span class="summary_signature">
59
151
 
152
+ <a href="#extended-class_method" title="extended (class method)">+ (Object) <strong>extended</strong>(obj) </a>
60
153
 
154
+
155
+
156
+ </span>
157
+
158
+
159
+
160
+
161
+
162
+
163
+
164
+
165
+
166
+ <span class="summary_desc"><div class='inline'>
167
+ <p>Called automaticallly when the object is extended with #extend.</p>
168
+ </div></span>
169
+
170
+ </li>
171
+
172
+
173
+ </ul>
174
+
175
+ <h2>
176
+ Instance Method Summary
177
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
178
+ </h2>
179
+
180
+ <ul class="summary">
181
+
182
+ <li class="public ">
183
+ <span class="summary_signature">
61
184
 
185
+ <a href="#expression-instance_method" title="#expression (instance method)">- (Object) <strong>expression</strong> </a>
62
186
 
63
- <!-- Method Quickref -->
64
- <div id="method-list-section" class="nav-section">
65
- <h3>Methods</h3>
66
187
 
67
- <ul class="link-list" role="directory">
68
188
 
69
- <li ><a href="#method-c-extended">::extended</a>
189
+ </span>
190
+
191
+
192
+
193
+
194
+
195
+
196
+
197
+
198
+
199
+ <span class="summary_desc"><div class='inline'>
200
+ <p>Returns the regular expression used for #read_match.</p>
201
+ </div></span>
202
+
203
+ </li>
204
+
205
+
206
+ <li class="public ">
207
+ <span class="summary_signature">
70
208
 
71
- <li ><a href="#method-i-expression">#expression</a>
209
+ <a href="#expression%3D-instance_method" title="#expression= (instance method)">- (Object) <strong>expression=</strong>(exp) </a>
72
210
 
73
- <li ><a href="#method-i-expression-3D">#expression=</a>
211
+
74
212
 
75
- <li ><a href="#method-i-has_data-3F">#has_data?</a>
213
+ </span>
214
+
215
+
216
+
217
+
218
+
219
+
220
+
221
+
222
+
223
+ <span class="summary_desc"><div class='inline'>
224
+ <p>Set the expression to match against the read buffer.</p>
225
+ </div></span>
226
+
227
+ </li>
228
+
229
+
230
+ <li class="public ">
231
+ <span class="summary_signature">
76
232
 
77
- <li ><a href="#method-i-initialize_ionian">#initialize_ionian</a>
233
+ <a href="#has_data%3F-instance_method" title="#has_data? (instance method)">- (Boolean) <strong>has_data?</strong>(timeout: 0) </a>
78
234
 
79
- <li ><a href="#method-i-on_match">#on_match</a>
235
+
80
236
 
81
- <li ><a href="#method-i-purge">#purge</a>
237
+ </span>
238
+
239
+
240
+
241
+
242
+
243
+
244
+
245
+
246
+
247
+ <span class="summary_desc"><div class='inline'>
248
+ <p>Returns true if there is data in the receive buffer.</p>
249
+ </div></span>
250
+
251
+ </li>
252
+
253
+
254
+ <li class="public ">
255
+ <span class="summary_signature">
82
256
 
83
- <li ><a href="#method-i-read_all">#read_all</a>
257
+ <a href="#initialize_ionian-instance_method" title="#initialize_ionian (instance method)">- (Object) <strong>initialize_ionian</strong> </a>
84
258
 
85
- <li ><a href="#method-i-read_match">#read_match</a>
259
+
86
260
 
87
- <li ><a href="#method-i-register_observer">#register_observer</a>
261
+ </span>
262
+
263
+
264
+
265
+
266
+
267
+
268
+
269
+
270
+
271
+ <span class="summary_desc"><div class='inline'>
272
+ <p>Initialize the Ionian instance variables.</p>
273
+ </div></span>
274
+
275
+ </li>
276
+
277
+
278
+ <li class="public ">
279
+ <span class="summary_signature">
88
280
 
89
- <li ><a href="#method-i-run_match">#run_match</a>
281
+ <a href="#purge-instance_method" title="#purge (instance method)">- (Object) <strong>purge</strong> </a>
90
282
 
91
- <li ><a href="#method-i-unregister_observer">#unregister_observer</a>
283
+
92
284
 
93
- </ul>
94
- </div>
285
+ </span>
286
+
287
+
288
+
289
+
290
+
291
+
292
+
95
293
 
96
- </div>
97
- </nav>
294
+
295
+ <span class="summary_desc"><div class='inline'>
296
+ <p>Erase the data in the IO and Ionian buffers.</p>
297
+ </div></span>
298
+
299
+ </li>
98
300
 
99
- <main role="main" aria-labelledby="module-Ionian::Extension::IO">
100
- <h1 id="module-Ionian::Extension::IO" class="module">
101
- module Ionian::Extension::IO
102
- </h1>
301
+
302
+ <li class="public ">
303
+ <span class="summary_signature">
304
+
305
+ <a href="#read_all-instance_method" title="#read_all (instance method)">- (Object) <strong>read_all</strong> </a>
306
+
103
307
 
104
- <section class="description">
105
308
 
106
- <p>A mixin for <a href="IO.html">IO</a> objects that allows regular expression
107
- matching and convenient notification of received data.</p>
309
+ </span>
310
+
311
+
312
+
313
+
314
+
315
+
316
+
108
317
 
109
- <p>This module was designed to be extended by instantiated objects that
110
- implement the standard library <a href="IO.html">IO</a> class.
111
- my_socket.extend Ionian::IO</p>
318
+
319
+ <span class="summary_desc"><div class='inline'>
320
+ <p>Read all data in the buffer.</p>
321
+ </div></span>
322
+
323
+ </li>
112
324
 
113
- </section>
325
+
326
+ <li class="public ">
327
+ <span class="summary_signature">
328
+
329
+ <a href="#read_match-instance_method" title="#read_match (instance method)">- (Object) <strong>read_match</strong>(**kwargs, &amp;block) </a>
330
+
114
331
 
332
+
333
+ </span>
334
+
335
+
336
+
115
337
 
116
338
 
117
339
 
118
- <section id="5Buntitled-5D" class="documentation-section">
340
+
341
+
342
+
343
+ <span class="summary_desc"><div class='inline'>
344
+ <p>Read matched data from the buffer.</p>
345
+ </div></span>
346
+
347
+ </li>
348
+
349
+
350
+ <li class="public ">
351
+ <span class="summary_signature">
352
+
353
+ <a href="#register_observer-instance_method" title="#register_observer (instance method)">- (Object) <strong>register_observer</strong>(&amp;block) </a>
119
354
 
120
355
 
121
356
 
357
+ (also: #on_match)
358
+
359
+ </span>
360
+
361
+
362
+
363
+
364
+
365
+
366
+
367
+
368
+
369
+ <span class="summary_desc"><div class='inline'>
370
+ <p>Register a block to be called when #run_match receives matched data.</p>
371
+ </div></span>
372
+
373
+ </li>
122
374
 
375
+
376
+ <li class="public ">
377
+ <span class="summary_signature">
378
+
379
+ <a href="#run_match-instance_method" title="#run_match (instance method)">- (Object) <strong>run_match</strong>(**kwargs) </a>
123
380
 
124
381
 
125
382
 
126
- <section class="attribute-method-details" class="method-section">
127
- <header>
128
- <h3>Attributes</h3>
129
- </header>
383
+ </span>
384
+
385
+
386
+
387
+
388
+
389
+
390
+
391
+
392
+
393
+ <span class="summary_desc"><div class='inline'>
394
+ <p>Start a thread that checks for data and notifies listeners (do |match,
395
+ socket|).</p>
396
+ </div></span>
397
+
398
+ </li>
130
399
 
131
400
 
132
- <div id="attribute-i-ionian_timeout" class="method-detail">
133
- <div class="method-heading attribute-method-heading">
134
- <span class="method-name">ionian_timeout</span><span
135
- class="attribute-access-type">[RW]</span>
136
- </div>
137
-
138
- <div class="method-description">
139
-
140
- <p>Number of seconds to attempt an <a href="IO.html">IO</a> operation before
141
- timing out. See standard library IO::select.</p>
142
-
143
- </div>
144
- </div>
401
+ <li class="public ">
402
+ <span class="summary_signature">
403
+
404
+ <a href="#unregister_observer-instance_method" title="#unregister_observer (instance method)">- (Object) <strong>unregister_observer</strong>(&amp;block) </a>
405
+
406
+
407
+
408
+ </span>
409
+
410
+
411
+
412
+
413
+
414
+
415
+
416
+
417
+
418
+ <span class="summary_desc"><div class='inline'>
419
+ <p>Unregister a block from being called when matched data is received.</p>
420
+ </div></span>
421
+
422
+ </li>
423
+
145
424
 
146
- </section>
147
-
148
-
149
-
150
- <section id="public-class-5Buntitled-5D-method-details" class="method-section">
151
- <header>
152
- <h3>Public Class Methods</h3>
153
- </header>
154
-
155
-
156
- <div id="method-c-extended" class="method-detail ">
157
-
158
- <div class="method-heading">
159
- <span class="method-name">extended</span><span
160
- class="method-args">(obj)</span>
161
-
162
- <span class="method-click-advice">click to toggle source</span>
163
-
164
- </div>
165
-
166
-
167
- <div class="method-description">
168
-
169
- <p>Called automaticallly when the object is extended with extend.</p>
170
-
171
-
172
-
173
-
174
- <div class="method-source-code" id="extended-source">
175
- <pre><span class="ruby-comment"># File lib/ionian/extension/io.rb, line 15</span>
176
- <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">extended</span>(<span class="ruby-identifier">obj</span>)
177
- <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">initialize_ionian</span>
178
- <span class="ruby-keyword">end</span></pre>
179
- </div>
180
-
181
- </div>
182
-
183
-
184
-
185
-
186
- </div>
187
-
188
-
189
- </section>
190
-
191
- <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
192
- <header>
193
- <h3>Public Instance Methods</h3>
194
- </header>
195
-
196
-
197
- <div id="method-i-expression" class="method-detail ">
198
-
199
- <div class="method-heading">
200
- <span class="method-name">expression</span><span
201
- class="method-args">()</span>
202
-
203
- <span class="method-click-advice">click to toggle source</span>
204
-
205
- </div>
206
-
207
-
208
- <div class="method-description">
209
-
210
- <p>Returns the regular expression used for <a
211
- href="IO.html#method-i-read_match">read_match</a>.</p>
212
-
213
-
214
-
215
-
216
- <div class="method-source-code" id="expression-source">
217
- <pre><span class="ruby-comment"># File lib/ionian/extension/io.rb, line 39</span>
218
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">expression</span>
219
- <span class="ruby-ivar">@ionian_expression</span>
220
- <span class="ruby-keyword">end</span></pre>
221
- </div>
222
-
223
- </div>
224
-
225
-
226
-
227
-
228
- </div>
229
-
230
-
231
- <div id="method-i-expression-3D" class="method-detail ">
232
-
233
- <div class="method-heading">
234
- <span class="method-name">expression=</span><span
235
- class="method-args">(exp)</span>
236
-
237
- <span class="method-click-advice">click to toggle source</span>
238
-
239
- </div>
240
-
241
-
242
- <div class="method-description">
243
-
244
- <p>Set the expression to match against the read buffer. Can be a regular
425
+ </ul>
426
+
427
+
428
+
429
+ <div id="instance_attr_details" class="attr_details">
430
+ <h2>Instance Attribute Details</h2>
431
+
432
+
433
+ <span id="ionian_timeout=-instance_method"></span>
434
+ <div class="method_details first">
435
+ <h3 class="signature first" id="ionian_timeout-instance_method">
436
+
437
+ - (<tt>Object</tt>) <strong>ionian_timeout</strong>
438
+
439
+
440
+
441
+
442
+
443
+ </h3><div class="docstring">
444
+ <div class="discussion">
445
+
446
+ <p>Number of seconds to attempt an IO operation before timing out. See
447
+ standard library IO::select.</p>
448
+
449
+
450
+ </div>
451
+ </div>
452
+ <div class="tags">
453
+
454
+
455
+ </div><table class="source_code">
456
+ <tr>
457
+ <td>
458
+ <pre class="lines">
459
+
460
+
461
+ 12
462
+ 13
463
+ 14</pre>
464
+ </td>
465
+ <td>
466
+ <pre class="code"><span class="info file"># File 'lib/ionian/extension/io.rb', line 12</span>
467
+
468
+ <span class='kw'>def</span> <span class='id identifier rubyid_ionian_timeout'>ionian_timeout</span>
469
+ <span class='ivar'>@ionian_timeout</span>
470
+ <span class='kw'>end</span></pre>
471
+ </td>
472
+ </tr>
473
+ </table>
474
+ </div>
475
+
476
+ </div>
477
+
478
+
479
+ <div id="class_method_details" class="method_details_list">
480
+ <h2>Class Method Details</h2>
481
+
482
+
483
+ <div class="method_details first">
484
+ <h3 class="signature first" id="extended-class_method">
485
+
486
+ + (<tt>Object</tt>) <strong>extended</strong>(obj)
487
+
488
+
489
+
490
+
491
+
492
+ </h3><div class="docstring">
493
+ <div class="discussion">
494
+
495
+ <p>Called automaticallly when the object is extended with #extend.</p>
496
+
497
+
498
+ </div>
499
+ </div>
500
+ <div class="tags">
501
+
502
+
503
+ </div><table class="source_code">
504
+ <tr>
505
+ <td>
506
+ <pre class="lines">
507
+
508
+
509
+ 15
510
+ 16
511
+ 17</pre>
512
+ </td>
513
+ <td>
514
+ <pre class="code"><span class="info file"># File 'lib/ionian/extension/io.rb', line 15</span>
515
+
516
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_extended'>extended</span><span class='lparen'>(</span><span class='id identifier rubyid_obj'>obj</span><span class='rparen'>)</span>
517
+ <span class='id identifier rubyid_obj'>obj</span><span class='period'>.</span><span class='id identifier rubyid_initialize_ionian'>initialize_ionian</span>
518
+ <span class='kw'>end</span></pre>
519
+ </td>
520
+ </tr>
521
+ </table>
522
+ </div>
523
+
524
+ </div>
525
+
526
+ <div id="instance_method_details" class="method_details_list">
527
+ <h2>Instance Method Details</h2>
528
+
529
+
530
+ <div class="method_details first">
531
+ <h3 class="signature first" id="expression-instance_method">
532
+
533
+ - (<tt>Object</tt>) <strong>expression</strong>
534
+
535
+
536
+
537
+
538
+
539
+ </h3><div class="docstring">
540
+ <div class="discussion">
541
+
542
+ <p>Returns the regular expression used for #read_match.</p>
543
+
544
+
545
+ </div>
546
+ </div>
547
+ <div class="tags">
548
+
549
+
550
+ </div><table class="source_code">
551
+ <tr>
552
+ <td>
553
+ <pre class="lines">
554
+
555
+
556
+ 39
557
+ 40
558
+ 41</pre>
559
+ </td>
560
+ <td>
561
+ <pre class="code"><span class="info file"># File 'lib/ionian/extension/io.rb', line 39</span>
562
+
563
+ <span class='kw'>def</span> <span class='id identifier rubyid_expression'>expression</span>
564
+ <span class='ivar'>@ionian_expression</span>
565
+ <span class='kw'>end</span></pre>
566
+ </td>
567
+ </tr>
568
+ </table>
569
+ </div>
570
+
571
+ <div class="method_details ">
572
+ <h3 class="signature " id="expression=-instance_method">
573
+
574
+ - (<tt>Object</tt>) <strong>expression=</strong>(exp)
575
+
576
+
577
+
578
+
579
+
580
+ </h3><div class="docstring">
581
+ <div class="discussion">
582
+
583
+ <p>Set the expression to match against the read buffer. Can be a regular
245
584
  expression specifying capture groups, or a string specifying the separator
246
585
  or line terminator sequence. It is possible to use named captures in a
247
586
  regex, which allows for convienient accessors like <a
248
587
  href=":parameter">match</a>.</p>
249
-
250
-
251
-
252
-
253
- <div class="method-source-code" id="expression-3D-source">
254
- <pre><span class="ruby-comment"># File lib/ionian/extension/io.rb, line 49</span>
255
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">expression=</span>(<span class="ruby-identifier">exp</span>)
256
- <span class="ruby-ivar">@ionian_expression</span> = <span class="ruby-identifier">exp</span>
257
- <span class="ruby-ivar">@ionian_expression</span> = <span class="ruby-constant">Regexp</span>.<span class="ruby-identifier">new</span> <span class="ruby-node">&quot;(.*?)#{expression}&quot;</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">exp</span>.<span class="ruby-identifier">is_a?</span> <span class="ruby-constant">String</span>
258
- <span class="ruby-keyword">end</span></pre>
259
- </div>
260
-
261
- </div>
262
-
263
-
264
-
265
-
266
- </div>
267
-
268
-
269
- <div id="method-i-has_data-3F" class="method-detail ">
270
-
271
- <div class="method-heading">
272
- <span class="method-name">has_data?</span><span
273
- class="method-args">(timeout: 0)</span>
274
-
275
- <span class="method-click-advice">click to toggle source</span>
276
-
277
- </div>
278
-
279
-
280
- <div class="method-description">
281
-
282
- <p>Returns true if there is data in the receive buffer. Args:</p>
283
-
284
- <pre>Timeout: Number of seconds to wait for data until
285
- giving up. Set to nil for blocking.</pre>
286
-
287
-
288
-
289
-
290
- <div class="method-source-code" id="has_data-3F-source">
291
- <pre><span class="ruby-comment"># File lib/ionian/extension/io.rb, line 34</span>
292
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">has_data?</span>(<span class="ruby-identifier">timeout</span><span class="ruby-operator">:</span> <span class="ruby-value">0</span>)
293
- <span class="ruby-operator">::</span><span class="ruby-constant">IO</span>.<span class="ruby-identifier">select</span>([<span class="ruby-keyword">self</span>], <span class="ruby-keyword">nil</span>, <span class="ruby-keyword">nil</span>, <span class="ruby-identifier">timeout</span>) <span class="ruby-operator">?</span> <span class="ruby-keyword">true</span> <span class="ruby-operator">:</span> <span class="ruby-keyword">false</span>
294
- <span class="ruby-keyword">end</span></pre>
295
- </div>
296
-
297
- </div>
298
-
299
-
300
-
301
-
302
- </div>
303
-
304
-
305
- <div id="method-i-initialize_ionian" class="method-detail ">
306
-
307
- <div class="method-heading">
308
- <span class="method-name">initialize_ionian</span><span
309
- class="method-args">()</span>
310
-
311
- <span class="method-click-advice">click to toggle source</span>
312
-
313
- </div>
314
-
315
-
316
- <div class="method-description">
317
-
318
- <p>Initialize the <a href="../../Ionian.html">Ionian</a> instance variables.
319
- This is called automatically if extend is called on an object.</p>
320
-
321
-
322
-
323
-
324
- <div class="method-source-code" id="initialize_ionian-source">
325
- <pre><span class="ruby-comment"># File lib/ionian/extension/io.rb, line 21</span>
326
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize_ionian</span>
327
- <span class="ruby-ivar">@ionian_listeners</span> = []
328
- <span class="ruby-ivar">@ionian_buf</span> = <span class="ruby-string">&#39;&#39;</span>
329
- <span class="ruby-ivar">@ionian_expression</span> = <span class="ruby-regexp">/(.*?)[\r\n]+/</span>
330
- <span class="ruby-ivar">@ionian_timeout</span> = <span class="ruby-keyword">nil</span>
331
- <span class="ruby-ivar">@ionian_skip_select</span> = <span class="ruby-keyword">false</span>
332
- <span class="ruby-ivar">@ionian_build_methods</span> = <span class="ruby-keyword">true</span>
333
- <span class="ruby-keyword">end</span></pre>
334
- </div>
335
-
336
- </div>
337
-
338
-
339
-
340
-
341
- </div>
342
-
343
-
344
- <div id="method-i-on_match" class="method-detail method-alias">
345
-
346
- <div class="method-heading">
347
- <span class="method-name">on_match</span><span
348
- class="method-args">(&block)</span>
349
-
350
- </div>
351
-
352
-
353
- <div class="method-description">
354
-
355
-
356
-
357
-
358
-
359
-
360
- </div>
361
-
362
-
363
-
364
-
365
- <div class="aliases">
366
- Alias for: <a href="IO.html#method-i-register_observer">register_observer</a>
367
- </div>
368
-
369
- </div>
370
-
371
-
372
- <div id="method-i-purge" class="method-detail ">
373
-
374
- <div class="method-heading">
375
- <span class="method-name">purge</span><span
376
- class="method-args">()</span>
377
-
378
- <span class="method-click-advice">click to toggle source</span>
379
-
380
- </div>
381
-
382
-
383
- <div class="method-description">
384
-
385
- <p>Erase the data in the <a href="IO.html">IO</a> and <a
386
- href="../../Ionian.html">Ionian</a> buffers. This is typically handled
588
+
589
+
590
+ </div>
591
+ </div>
592
+ <div class="tags">
593
+
594
+
595
+ </div><table class="source_code">
596
+ <tr>
597
+ <td>
598
+ <pre class="lines">
599
+
600
+
601
+ 49
602
+ 50
603
+ 51
604
+ 52</pre>
605
+ </td>
606
+ <td>
607
+ <pre class="code"><span class="info file"># File 'lib/ionian/extension/io.rb', line 49</span>
608
+
609
+ <span class='kw'>def</span> <span class='id identifier rubyid_expression='>expression=</span><span class='lparen'>(</span><span class='id identifier rubyid_exp'>exp</span><span class='rparen'>)</span>
610
+ <span class='ivar'>@ionian_expression</span> <span class='op'>=</span> <span class='id identifier rubyid_exp'>exp</span>
611
+ <span class='ivar'>@ionian_expression</span> <span class='op'>=</span> <span class='const'>Regexp</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>(.*?)</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_expression'>expression</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_exp'>exp</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span> <span class='const'>String</span>
612
+ <span class='kw'>end</span></pre>
613
+ </td>
614
+ </tr>
615
+ </table>
616
+ </div>
617
+
618
+ <div class="method_details ">
619
+ <h3 class="signature " id="has_data?-instance_method">
620
+
621
+ - (<tt>Boolean</tt>) <strong>has_data?</strong>(timeout: 0)
622
+
623
+
624
+
625
+
626
+
627
+ </h3><div class="docstring">
628
+ <div class="discussion">
629
+
630
+ <p>Returns true if there is data in the receive buffer. Args:</p>
631
+
632
+ <pre class="code ruby"><code class="ruby">Timeout: Number of seconds to wait for data until
633
+ giving up. Set to nil for blocking.</code></pre>
634
+
635
+
636
+ </div>
637
+ </div>
638
+ <div class="tags">
639
+
640
+ <p class="tag_title">Returns:</p>
641
+ <ul class="return">
642
+
643
+ <li>
644
+
645
+
646
+ <span class='type'>(<tt>Boolean</tt>)</span>
647
+
648
+
649
+
650
+ </li>
651
+
652
+ </ul>
653
+
654
+ </div><table class="source_code">
655
+ <tr>
656
+ <td>
657
+ <pre class="lines">
658
+
659
+
660
+ 34
661
+ 35
662
+ 36</pre>
663
+ </td>
664
+ <td>
665
+ <pre class="code"><span class="info file"># File 'lib/ionian/extension/io.rb', line 34</span>
666
+
667
+ <span class='kw'>def</span> <span class='id identifier rubyid_has_data?'>has_data?</span><span class='lparen'>(</span><span class='label'>timeout:</span> <span class='int'>0</span><span class='rparen'>)</span>
668
+ <span class='op'>::</span><span class='const'>IO</span><span class='period'>.</span><span class='id identifier rubyid_select'>select</span><span class='lparen'>(</span><span class='lbracket'>[</span><span class='kw'>self</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_timeout'>timeout</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='kw'>true</span> <span class='op'>:</span> <span class='kw'>false</span>
669
+ <span class='kw'>end</span></pre>
670
+ </td>
671
+ </tr>
672
+ </table>
673
+ </div>
674
+
675
+ <div class="method_details ">
676
+ <h3 class="signature " id="initialize_ionian-instance_method">
677
+
678
+ - (<tt>Object</tt>) <strong>initialize_ionian</strong>
679
+
680
+
681
+
682
+
683
+
684
+ </h3><div class="docstring">
685
+ <div class="discussion">
686
+
687
+ <p>Initialize the Ionian instance variables. This is called automatically if
688
+ #extend is called on an object.</p>
689
+
690
+
691
+ </div>
692
+ </div>
693
+ <div class="tags">
694
+
695
+
696
+ </div><table class="source_code">
697
+ <tr>
698
+ <td>
699
+ <pre class="lines">
700
+
701
+
702
+ 21
703
+ 22
704
+ 23
705
+ 24
706
+ 25
707
+ 26
708
+ 27
709
+ 28</pre>
710
+ </td>
711
+ <td>
712
+ <pre class="code"><span class="info file"># File 'lib/ionian/extension/io.rb', line 21</span>
713
+
714
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize_ionian'>initialize_ionian</span>
715
+ <span class='ivar'>@ionian_listeners</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
716
+ <span class='ivar'>@ionian_buf</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_end'>&#39;</span></span>
717
+ <span class='ivar'>@ionian_expression</span> <span class='op'>=</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>(.*?)[\r\n]+</span><span class='regexp_end'>/</span></span>
718
+ <span class='ivar'>@ionian_timeout</span> <span class='op'>=</span> <span class='kw'>nil</span>
719
+ <span class='ivar'>@ionian_skip_select</span> <span class='op'>=</span> <span class='kw'>false</span>
720
+ <span class='ivar'>@ionian_build_methods</span> <span class='op'>=</span> <span class='kw'>true</span>
721
+ <span class='kw'>end</span></pre>
722
+ </td>
723
+ </tr>
724
+ </table>
725
+ </div>
726
+
727
+ <div class="method_details ">
728
+ <h3 class="signature " id="purge-instance_method">
729
+
730
+ - (<tt>Object</tt>) <strong>purge</strong>
731
+
732
+
733
+
734
+
735
+
736
+ </h3><div class="docstring">
737
+ <div class="discussion">
738
+
739
+ <p>Erase the data in the IO and Ionian buffers. This is typically handled
387
740
  automatically.</p>
388
-
389
-
390
-
391
-
392
- <div class="method-source-code" id="purge-source">
393
- <pre><span class="ruby-comment"># File lib/ionian/extension/io.rb, line 151</span>
394
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">purge</span>
395
- <span class="ruby-comment"># Erase IO buffer.</span>
396
- <span class="ruby-keyword">while</span> <span class="ruby-operator">::</span><span class="ruby-constant">IO</span>.<span class="ruby-identifier">select</span> [<span class="ruby-keyword">self</span>], <span class="ruby-keyword">nil</span>, <span class="ruby-keyword">nil</span>, <span class="ruby-value">0</span>
397
- <span class="ruby-identifier">readpartial</span>(<span class="ruby-value">0xFFFF</span>)
398
- <span class="ruby-keyword">end</span>
399
-
400
- <span class="ruby-ivar">@ionian_buf</span> = <span class="ruby-string">&#39;&#39;</span>
401
- <span class="ruby-keyword">end</span></pre>
402
- </div>
403
-
404
- </div>
405
-
406
-
407
-
408
-
409
- </div>
410
-
411
-
412
- <div id="method-i-read_all" class="method-detail ">
413
-
414
- <div class="method-heading">
415
- <span class="method-name">read_all</span><span
416
- class="method-args">()</span>
417
-
418
- <span class="method-click-advice">click to toggle source</span>
419
-
420
- </div>
421
-
422
-
423
- <div class="method-description">
424
-
425
- <p>Read all data in the buffer. An alternative to using readpartial with a
741
+
742
+
743
+ </div>
744
+ </div>
745
+ <div class="tags">
746
+
747
+
748
+ </div><table class="source_code">
749
+ <tr>
750
+ <td>
751
+ <pre class="lines">
752
+
753
+
754
+ 153
755
+ 154
756
+ 155
757
+ 156
758
+ 157
759
+ 158
760
+ 159
761
+ 160</pre>
762
+ </td>
763
+ <td>
764
+ <pre class="code"><span class="info file"># File 'lib/ionian/extension/io.rb', line 153</span>
765
+
766
+ <span class='kw'>def</span> <span class='id identifier rubyid_purge'>purge</span>
767
+ <span class='comment'># Erase IO buffer.
768
+ </span> <span class='kw'>while</span> <span class='op'>::</span><span class='const'>IO</span><span class='period'>.</span><span class='id identifier rubyid_select'>select</span> <span class='lbracket'>[</span><span class='kw'>self</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='int'>0</span>
769
+ <span class='id identifier rubyid_readpartial'>readpartial</span><span class='lparen'>(</span><span class='int'>0xFFFF</span><span class='rparen'>)</span>
770
+ <span class='kw'>end</span>
771
+
772
+ <span class='ivar'>@ionian_buf</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_end'>&#39;</span></span>
773
+ <span class='kw'>end</span></pre>
774
+ </td>
775
+ </tr>
776
+ </table>
777
+ </div>
778
+
779
+ <div class="method_details ">
780
+ <h3 class="signature " id="read_all-instance_method">
781
+
782
+ - (<tt>Object</tt>) <strong>read_all</strong>
783
+
784
+
785
+
786
+
787
+
788
+ </h3><div class="docstring">
789
+ <div class="discussion">
790
+
791
+ <p>Read all data in the buffer. An alternative to using #readpartial with a
426
792
  large length.</p>
427
-
428
-
429
-
430
-
431
- <div class="method-source-code" id="read_all-source">
432
- <pre><span class="ruby-comment"># File lib/ionian/extension/io.rb, line 56</span>
433
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">read_all</span>
434
- <span class="ruby-identifier">readpartial</span> <span class="ruby-value">0xFFFF</span>
435
- <span class="ruby-keyword">end</span></pre>
436
- </div>
437
-
438
- </div>
439
-
440
-
441
-
442
-
443
- </div>
444
-
445
-
446
- <div id="method-i-read_match" class="method-detail ">
447
-
448
- <div class="method-heading">
449
- <span class="method-name">read_match</span><span
450
- class="method-args">(**kwargs) { |$~| ... }</span>
451
-
452
- <span class="method-click-advice">click to toggle source</span>
453
-
454
- </div>
455
-
456
-
457
- <div class="method-description">
458
-
459
- <p>Read matched data from the buffer. This method SHOULD NOT be used if <a
460
- href="IO.html#method-i-run_match">run_match</a> is used.</p>
793
+
794
+
795
+ </div>
796
+ </div>
797
+ <div class="tags">
798
+
799
+
800
+ </div><table class="source_code">
801
+ <tr>
802
+ <td>
803
+ <pre class="lines">
804
+
805
+
806
+ 56
807
+ 57
808
+ 58</pre>
809
+ </td>
810
+ <td>
811
+ <pre class="code"><span class="info file"># File 'lib/ionian/extension/io.rb', line 56</span>
812
+
813
+ <span class='kw'>def</span> <span class='id identifier rubyid_read_all'>read_all</span>
814
+ <span class='id identifier rubyid_readpartial'>readpartial</span> <span class='int'>0xFFFF</span>
815
+ <span class='kw'>end</span></pre>
816
+ </td>
817
+ </tr>
818
+ </table>
819
+ </div>
820
+
821
+ <div class="method_details ">
822
+ <h3 class="signature " id="read_match-instance_method">
823
+
824
+ - (<tt>Object</tt>) <strong>read_match</strong>(**kwargs, &amp;block)
825
+
826
+
827
+
828
+
829
+
830
+ </h3><div class="docstring">
831
+ <div class="discussion">
832
+
833
+ <p>Read matched data from the buffer. This method SHOULD NOT be used if
834
+ #run_match is used.</p>
461
835
 
462
836
  <p>Passes matches to the block (do |match|). If there are multiple matches,
463
837
  the block is called multiple times.</p>
@@ -470,210 +844,299 @@ with match.pre_match.</p>
470
844
 
471
845
  <p>Data at the end of the buffer that is not matched can be accessed in the
472
846
  last match with match.post_match. This data remains in the buffer for the
473
- next <a href="IO.html#method-i-read_match">read_match</a> cycle. This is
474
- helpful for protocols like RS232 that do not have packet boundries.</p>
847
+ next #read_match cycle. This is helpful for protocols like RS232 that do
848
+ not have packet boundries.</p>
475
849
 
476
850
  <p>kwargs:</p>
477
851
 
478
- <pre>timeout: Timeout in seconds IO::select will block.
852
+ <pre class="code ruby"><code class="ruby">timeout: Timeout in seconds IO::select will block.
479
853
  expression: Override the expression match for this single
480
854
  method call.
481
855
  notify: Set to false to skip notifying match listener procs.
482
856
  skip_select: Skip over the IO::select statement. Use if you
483
857
  are calling IO::select ahead of this method.
484
858
  build_methods: Build accessor methods from named capture groups.
485
- Enabled by default.</pre>
486
-
487
-
488
-
489
-
490
- <div class="method-source-code" id="read_match-source">
491
- <pre><span class="ruby-comment"># File lib/ionian/extension/io.rb, line 86</span>
492
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">read_match</span>(<span class="ruby-operator">**</span><span class="ruby-identifier">kwargs</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
493
- <span class="ruby-identifier">timeout</span> = <span class="ruby-identifier">kwargs</span>.<span class="ruby-identifier">fetch</span> <span class="ruby-value">:timeout</span>, <span class="ruby-ivar">@ionian_timeout</span>
494
- <span class="ruby-identifier">notify</span> = <span class="ruby-identifier">kwargs</span>.<span class="ruby-identifier">fetch</span> <span class="ruby-value">:notify</span>, <span class="ruby-keyword">true</span>
495
- <span class="ruby-identifier">skip_select</span> = <span class="ruby-identifier">kwargs</span>.<span class="ruby-identifier">fetch</span> <span class="ruby-value">:skip_select</span>, <span class="ruby-ivar">@ionian_skip_select</span>
496
- <span class="ruby-identifier">build_methods</span> = <span class="ruby-identifier">kwargs</span>.<span class="ruby-identifier">fetch</span> <span class="ruby-value">:build_methods</span>, <span class="ruby-ivar">@ionian_build_methods</span>
497
-
498
- <span class="ruby-identifier">exp</span> = <span class="ruby-identifier">kwargs</span>.<span class="ruby-identifier">fetch</span> <span class="ruby-value">:expression</span>, <span class="ruby-ivar">@ionian_expression</span>
499
- <span class="ruby-identifier">exp</span> = <span class="ruby-constant">Regexp</span>.<span class="ruby-identifier">new</span> <span class="ruby-node">&quot;(.*?)#{exp}&quot;</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">exp</span>.<span class="ruby-identifier">is_a?</span> <span class="ruby-constant">String</span>
500
-
501
- <span class="ruby-keyword">unless</span> <span class="ruby-identifier">skip_select</span>
502
- <span class="ruby-keyword">return</span> <span class="ruby-keyword">nil</span> <span class="ruby-keyword">unless</span> <span class="ruby-operator">::</span><span class="ruby-constant">IO</span>.<span class="ruby-identifier">select</span> [<span class="ruby-keyword">self</span>], <span class="ruby-keyword">nil</span>, <span class="ruby-keyword">nil</span>, <span class="ruby-identifier">timeout</span>
503
- <span class="ruby-keyword">end</span>
504
-
505
- <span class="ruby-comment"># Read data from the IO buffer until it&#39;s empty.</span>
506
- <span class="ruby-identifier">loop</span> <span class="ruby-keyword">do</span>
507
- <span class="ruby-ivar">@ionian_buf</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">readpartial</span>(<span class="ruby-value">0xFFFF</span>)
508
- <span class="ruby-keyword">break</span> <span class="ruby-keyword">unless</span> <span class="ruby-operator">::</span><span class="ruby-constant">IO</span>.<span class="ruby-identifier">select</span> [<span class="ruby-keyword">self</span>], <span class="ruby-keyword">nil</span>, <span class="ruby-keyword">nil</span>, <span class="ruby-value">0</span>
509
- <span class="ruby-keyword">end</span>
510
-
511
- <span class="ruby-ivar">@matches</span> = []
512
-
513
- <span class="ruby-keyword">while</span> <span class="ruby-ivar">@ionian_buf</span> <span class="ruby-operator">=~</span> <span class="ruby-identifier">exp</span>
514
- <span class="ruby-ivar">@matches</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">$~</span> <span class="ruby-comment"># Match data.</span>
515
- <span class="ruby-keyword">yield</span> <span class="ruby-identifier">$~</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">block_given?</span>
516
- <span class="ruby-ivar">@ionian_buf</span> = <span class="ruby-node">$&#39;</span> <span class="ruby-comment"># Leave post match data in the buffer.</span>
517
- <span class="ruby-keyword">end</span>
518
-
519
- <span class="ruby-comment"># Convert named captures to methods.</span>
520
- <span class="ruby-keyword">if</span> <span class="ruby-identifier">build_methods</span>
521
- <span class="ruby-ivar">@matches</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">match</span><span class="ruby-operator">|</span>
522
- <span class="ruby-identifier">match</span>.<span class="ruby-identifier">names</span>
523
- .<span class="ruby-identifier">map</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">name</span><span class="ruby-operator">|</span> <span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_sym</span>}
524
- .<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">symbol</span><span class="ruby-operator">|</span> <span class="ruby-identifier">match</span>.<span class="ruby-identifier">singleton_class</span>
525
- .<span class="ruby-identifier">send</span>(<span class="ruby-value">:define_method</span>, <span class="ruby-identifier">symbol</span>) { <span class="ruby-identifier">match</span>[<span class="ruby-identifier">symbol</span>] } <span class="ruby-keyword">unless</span> <span class="ruby-identifier">match</span>.<span class="ruby-identifier">respond_to?</span> <span class="ruby-identifier">symbol</span>
526
- }
527
- <span class="ruby-keyword">end</span>
528
- <span class="ruby-keyword">end</span>
529
-
530
- <span class="ruby-comment"># Notify on_match listeners unless the #run_match thread is active.</span>
531
- <span class="ruby-ivar">@matches</span>.<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">match</span><span class="ruby-operator">|</span> <span class="ruby-identifier">notify_listeners</span> <span class="ruby-identifier">match</span>} <span class="ruby-keyword">if</span> <span class="ruby-identifier">notify</span> <span class="ruby-keyword">and</span> <span class="ruby-keyword">not</span> <span class="ruby-ivar">@match_listener</span>
532
-
533
- <span class="ruby-ivar">@matches</span>
534
- <span class="ruby-keyword">end</span></pre>
535
- </div>
536
-
537
- </div>
538
-
539
-
540
-
541
-
542
- </div>
543
-
544
-
545
- <div id="method-i-register_observer" class="method-detail ">
546
-
547
- <div class="method-heading">
548
- <span class="method-name">register_observer</span><span
549
- class="method-args">(&block)</span>
550
-
551
- <span class="method-click-advice">click to toggle source</span>
552
-
553
- </div>
554
-
555
-
556
- <div class="method-description">
557
-
558
- <p>Register a block to be called when <a
559
- href="IO.html#method-i-run_match">run_match</a> receives matched data.
560
- Method callbacks can be registered with &amp;object.method(:method).
561
- Returns a reference to the given block. block =
562
- ionian_socket.register_observer {…}</p>
563
-
564
-
565
-
566
-
567
- <div class="method-source-code" id="register_observer-source">
568
- <pre><span class="ruby-comment"># File lib/ionian/extension/io.rb, line 164</span>
569
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">register_observer</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
570
- <span class="ruby-ivar">@ionian_listeners</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">block</span> <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@ionian_listeners</span>.<span class="ruby-identifier">include?</span> <span class="ruby-identifier">block</span>
571
- <span class="ruby-identifier">block</span>
572
- <span class="ruby-keyword">end</span></pre>
573
- </div>
574
-
575
- </div>
576
-
577
-
578
- <div class="aliases">
579
- Also aliased as: <a href="IO.html#method-i-on_match">on_match</a>
580
- </div>
581
-
582
-
583
-
584
- </div>
585
-
586
-
587
- <div id="method-i-run_match" class="method-detail ">
588
-
589
- <div class="method-heading">
590
- <span class="method-name">run_match</span><span
591
- class="method-args">(**kwargs)</span>
592
-
593
- <span class="method-click-advice">click to toggle source</span>
594
-
595
- </div>
596
-
597
-
598
- <div class="method-description">
599
-
600
- <p>Start a thread that checks for data and notifies listeners (do |match,
601
- socket|). Passes kwargs to <a
602
- href="IO.html#method-i-read_match">read_match</a>. This method SHOULD NOT
603
- be used if <a href="IO.html#method-i-read_match">read_match</a> is used.</p>
604
-
605
-
606
-
607
-
608
- <div class="method-source-code" id="run_match-source">
609
- <pre><span class="ruby-comment"># File lib/ionian/extension/io.rb, line 134</span>
610
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">run_match</span>(<span class="ruby-operator">**</span><span class="ruby-identifier">kwargs</span>)
611
- <span class="ruby-ivar">@match_listener</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword">do</span>
612
- <span class="ruby-keyword">begin</span>
613
- <span class="ruby-keyword">while</span> <span class="ruby-keyword">not</span> <span class="ruby-identifier">closed?</span> <span class="ruby-keyword">do</span>
614
- <span class="ruby-identifier">matches</span> = <span class="ruby-identifier">read_match</span> <span class="ruby-operator">**</span><span class="ruby-identifier">kwargs</span>
615
- <span class="ruby-identifier">matches</span>.<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">match</span><span class="ruby-operator">|</span> <span class="ruby-identifier">notify_listeners</span> <span class="ruby-identifier">match</span> } <span class="ruby-keyword">if</span> <span class="ruby-identifier">matches</span>
616
- <span class="ruby-keyword">end</span>
617
- <span class="ruby-keyword">rescue</span> <span class="ruby-constant">EOFError</span>
618
- <span class="ruby-keyword">rescue</span> <span class="ruby-constant">IOError</span>
619
- <span class="ruby-keyword">ensure</span>
620
- <span class="ruby-ivar">@match_listener</span> = <span class="ruby-keyword">nil</span>
621
- <span class="ruby-keyword">end</span>
622
- <span class="ruby-keyword">end</span>
623
- <span class="ruby-keyword">end</span></pre>
624
- </div>
625
-
626
- </div>
627
-
628
-
629
-
630
-
631
- </div>
632
-
633
-
634
- <div id="method-i-unregister_observer" class="method-detail ">
635
-
636
- <div class="method-heading">
637
- <span class="method-name">unregister_observer</span><span
638
- class="method-args">(&block)</span>
639
-
640
- <span class="method-click-advice">click to toggle source</span>
641
-
642
- </div>
643
-
644
-
645
- <div class="method-description">
646
-
647
- <p>Unregister a block from being called when matched data is received.</p>
648
-
649
-
650
-
651
-
652
- <div class="method-source-code" id="unregister_observer-source">
653
- <pre><span class="ruby-comment"># File lib/ionian/extension/io.rb, line 172</span>
654
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">unregister_observer</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
655
- <span class="ruby-ivar">@ionian_listeners</span>.<span class="ruby-identifier">delete_if</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">o</span><span class="ruby-operator">|</span> <span class="ruby-identifier">o</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">block</span>}
656
- <span class="ruby-identifier">block</span>
657
- <span class="ruby-keyword">end</span></pre>
658
- </div>
659
-
660
- </div>
661
-
662
-
663
-
664
-
665
- </div>
666
-
667
-
668
- </section>
669
-
670
- </section>
671
- </main>
672
-
673
-
674
- <footer id="validator-badges" role="contentinfo">
675
- <p><a href="http://validator.w3.org/check/referer">Validate</a>
676
- <p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.1.
677
- <p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
678
- </footer>
859
+ Enabled by default.</code></pre>
860
+
861
+
862
+ </div>
863
+ </div>
864
+ <div class="tags">
865
+
866
+
867
+ </div><table class="source_code">
868
+ <tr>
869
+ <td>
870
+ <pre class="lines">
871
+
872
+
873
+ 86
874
+ 87
875
+ 88
876
+ 89
877
+ 90
878
+ 91
879
+ 92
880
+ 93
881
+ 94
882
+ 95
883
+ 96
884
+ 97
885
+ 98
886
+ 99
887
+ 100
888
+ 101
889
+ 102
890
+ 103
891
+ 104
892
+ 105
893
+ 106
894
+ 107
895
+ 108
896
+ 109
897
+ 110
898
+ 111
899
+ 112
900
+ 113
901
+ 114
902
+ 115
903
+ 116
904
+ 117
905
+ 118
906
+ 119
907
+ 120
908
+ 121
909
+ 122
910
+ 123
911
+ 124
912
+ 125
913
+ 126
914
+ 127
915
+ 128
916
+ 129
917
+ 130
918
+ 131</pre>
919
+ </td>
920
+ <td>
921
+ <pre class="code"><span class="info file"># File 'lib/ionian/extension/io.rb', line 86</span>
922
+
923
+ <span class='kw'>def</span> <span class='id identifier rubyid_read_match'>read_match</span><span class='lparen'>(</span><span class='op'>**</span><span class='id identifier rubyid_kwargs'>kwargs</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
924
+ <span class='id identifier rubyid_timeout'>timeout</span> <span class='op'>=</span> <span class='id identifier rubyid_kwargs'>kwargs</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span> <span class='symbol'>:timeout</span><span class='comma'>,</span> <span class='ivar'>@ionian_timeout</span>
925
+ <span class='id identifier rubyid_notify'>notify</span> <span class='op'>=</span> <span class='id identifier rubyid_kwargs'>kwargs</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span> <span class='symbol'>:notify</span><span class='comma'>,</span> <span class='kw'>true</span>
926
+ <span class='id identifier rubyid_skip_select'>skip_select</span> <span class='op'>=</span> <span class='id identifier rubyid_kwargs'>kwargs</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span> <span class='symbol'>:skip_select</span><span class='comma'>,</span> <span class='ivar'>@ionian_skip_select</span>
927
+ <span class='id identifier rubyid_build_methods'>build_methods</span> <span class='op'>=</span> <span class='id identifier rubyid_kwargs'>kwargs</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span> <span class='symbol'>:build_methods</span><span class='comma'>,</span> <span class='ivar'>@ionian_build_methods</span>
928
+
929
+ <span class='id identifier rubyid_exp'>exp</span> <span class='op'>=</span> <span class='id identifier rubyid_kwargs'>kwargs</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span> <span class='symbol'>:expression</span><span class='comma'>,</span> <span class='ivar'>@ionian_expression</span>
930
+ <span class='id identifier rubyid_exp'>exp</span> <span class='op'>=</span> <span class='const'>Regexp</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>(.*?)</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_exp'>exp</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_exp'>exp</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span> <span class='const'>String</span>
931
+
932
+ <span class='kw'>unless</span> <span class='id identifier rubyid_skip_select'>skip_select</span>
933
+ <span class='kw'>return</span> <span class='kw'>nil</span> <span class='kw'>unless</span> <span class='op'>::</span><span class='const'>IO</span><span class='period'>.</span><span class='id identifier rubyid_select'>select</span> <span class='lbracket'>[</span><span class='kw'>self</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_timeout'>timeout</span>
934
+ <span class='kw'>end</span>
935
+
936
+ <span class='comment'># Read data from the IO buffer until it&#39;s empty.
937
+ </span> <span class='id identifier rubyid_loop'>loop</span> <span class='kw'>do</span>
938
+ <span class='ivar'>@ionian_buf</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_readpartial'>readpartial</span><span class='lparen'>(</span><span class='int'>0xFFFF</span><span class='rparen'>)</span>
939
+ <span class='kw'>break</span> <span class='kw'>unless</span> <span class='op'>::</span><span class='const'>IO</span><span class='period'>.</span><span class='id identifier rubyid_select'>select</span> <span class='lbracket'>[</span><span class='kw'>self</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='int'>0</span>
940
+ <span class='kw'>end</span>
941
+
942
+ <span class='ivar'>@matches</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
943
+
944
+ <span class='kw'>while</span> <span class='ivar'>@ionian_buf</span> <span class='op'>=~</span> <span class='id identifier rubyid_exp'>exp</span>
945
+ <span class='ivar'>@matches</span> <span class='op'>&lt;&lt;</span> <span class='gvar'>$~</span> <span class='comment'># Match data.
946
+ </span> <span class='ivar'>@ionian_buf</span> <span class='op'>=</span> <span class='backref'>$&#39;</span> <span class='comment'># Leave post match data in the buffer.
947
+ </span> <span class='kw'>end</span>
948
+
949
+ <span class='comment'># Convert named captures to methods.
950
+ </span> <span class='kw'>if</span> <span class='id identifier rubyid_build_methods'>build_methods</span>
951
+ <span class='ivar'>@matches</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_match'>match</span><span class='op'>|</span>
952
+ <span class='id identifier rubyid_match'>match</span><span class='period'>.</span><span class='id identifier rubyid_names'>names</span><span class='period'>
953
+ </span><span class='id identifier rubyid_ .map'> .map</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_name'>name</span><span class='op'>|</span> <span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span><span class='rbrace'>}</span><span class='period'>
954
+ </span><span class='id identifier rubyid_ .each'> .each</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_symbol'>symbol</span><span class='op'>|</span> <span class='id identifier rubyid_match'>match</span><span class='period'>.</span><span class='id identifier rubyid_singleton_class'>singleton_class</span><span class='period'>
955
+ </span><span class='id identifier rubyid_ .send'> .send</span><span class='lparen'>(</span><span class='symbol'>:define_method</span><span class='comma'>,</span> <span class='id identifier rubyid_symbol'>symbol</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='id identifier rubyid_match'>match</span><span class='lbracket'>[</span><span class='id identifier rubyid_symbol'>symbol</span><span class='rbracket'>]</span> <span class='rbrace'>}</span> \
956
+ <span class='kw'>unless</span> <span class='id identifier rubyid_match'>match</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span> <span class='id identifier rubyid_symbol'>symbol</span>
957
+ <span class='rbrace'>}</span>
958
+ <span class='kw'>end</span>
959
+ <span class='kw'>end</span>
960
+
961
+ <span class='comment'># Pass each match to block.
962
+ </span> <span class='ivar'>@matches</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_match'>match</span><span class='op'>|</span> <span class='kw'>yield</span> <span class='id identifier rubyid_match'>match</span><span class='rbrace'>}</span> <span class='kw'>if</span> <span class='id identifier rubyid_block_given?'>block_given?</span>
963
+
964
+ <span class='comment'># Notify on_match listeners unless the #run_match thread is active.
965
+ </span> <span class='ivar'>@matches</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_match'>match</span><span class='op'>|</span> <span class='id identifier rubyid_notify_listeners'>notify_listeners</span> <span class='id identifier rubyid_match'>match</span><span class='rbrace'>}</span> <span class='kw'>if</span> <span class='id identifier rubyid_notify'>notify</span> <span class='kw'>and</span> <span class='kw'>not</span> <span class='ivar'>@match_listener</span>
966
+
967
+ <span class='ivar'>@matches</span>
968
+ <span class='kw'>end</span></pre>
969
+ </td>
970
+ </tr>
971
+ </table>
972
+ </div>
973
+
974
+ <div class="method_details ">
975
+ <h3 class="signature " id="register_observer-instance_method">
976
+
977
+ - (<tt>Object</tt>) <strong>register_observer</strong>(&amp;block)
978
+
979
+
980
+
981
+ <span class="aliases">Also known as:
982
+ <span class="names"><span id='on_match-instance_method'>on_match</span></span>
983
+ </span>
984
+
985
+
986
+
987
+ </h3><div class="docstring">
988
+ <div class="discussion">
989
+
990
+ <p>Register a block to be called when #run_match receives matched data. Method
991
+ callbacks can be registered with &amp;object.method(:method). Returns a
992
+ reference to the given block. block = ionian_socket.register_observer { … }</p>
993
+
994
+
995
+ </div>
996
+ </div>
997
+ <div class="tags">
998
+
999
+
1000
+ </div><table class="source_code">
1001
+ <tr>
1002
+ <td>
1003
+ <pre class="lines">
1004
+
1005
+
1006
+ 166
1007
+ 167
1008
+ 168
1009
+ 169</pre>
1010
+ </td>
1011
+ <td>
1012
+ <pre class="code"><span class="info file"># File 'lib/ionian/extension/io.rb', line 166</span>
1013
+
1014
+ <span class='kw'>def</span> <span class='id identifier rubyid_register_observer'>register_observer</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
1015
+ <span class='ivar'>@ionian_listeners</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_block'>block</span> <span class='kw'>unless</span> <span class='ivar'>@ionian_listeners</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span> <span class='id identifier rubyid_block'>block</span>
1016
+ <span class='id identifier rubyid_block'>block</span>
1017
+ <span class='kw'>end</span></pre>
1018
+ </td>
1019
+ </tr>
1020
+ </table>
1021
+ </div>
1022
+
1023
+ <div class="method_details ">
1024
+ <h3 class="signature " id="run_match-instance_method">
1025
+
1026
+ - (<tt>Object</tt>) <strong>run_match</strong>(**kwargs)
1027
+
1028
+
1029
+
1030
+
1031
+
1032
+ </h3><div class="docstring">
1033
+ <div class="discussion">
1034
+
1035
+ <p>Start a thread that checks for data and notifies listeners (do |match,
1036
+ socket|). Passes kwargs to #read_match. This method SHOULD NOT be used if
1037
+ #read_match is used.</p>
1038
+
1039
+
1040
+ </div>
1041
+ </div>
1042
+ <div class="tags">
1043
+
1044
+
1045
+ </div><table class="source_code">
1046
+ <tr>
1047
+ <td>
1048
+ <pre class="lines">
1049
+
1050
+
1051
+ 136
1052
+ 137
1053
+ 138
1054
+ 139
1055
+ 140
1056
+ 141
1057
+ 142
1058
+ 143
1059
+ 144
1060
+ 145
1061
+ 146
1062
+ 147
1063
+ 148
1064
+ 149</pre>
1065
+ </td>
1066
+ <td>
1067
+ <pre class="code"><span class="info file"># File 'lib/ionian/extension/io.rb', line 136</span>
1068
+
1069
+ <span class='kw'>def</span> <span class='id identifier rubyid_run_match'>run_match</span><span class='lparen'>(</span><span class='op'>**</span><span class='id identifier rubyid_kwargs'>kwargs</span><span class='rparen'>)</span>
1070
+ <span class='ivar'>@match_listener</span> <span class='op'>||=</span> <span class='const'>Thread</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='kw'>do</span>
1071
+ <span class='kw'>begin</span>
1072
+ <span class='kw'>while</span> <span class='kw'>not</span> <span class='id identifier rubyid_closed?'>closed?</span> <span class='kw'>do</span>
1073
+ <span class='id identifier rubyid_matches'>matches</span> <span class='op'>=</span> <span class='id identifier rubyid_read_match'>read_match</span> <span class='op'>**</span><span class='id identifier rubyid_kwargs'>kwargs</span>
1074
+ <span class='id identifier rubyid_matches'>matches</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_match'>match</span><span class='op'>|</span> <span class='id identifier rubyid_notify_listeners'>notify_listeners</span> <span class='id identifier rubyid_match'>match</span> <span class='rbrace'>}</span> <span class='kw'>if</span> <span class='id identifier rubyid_matches'>matches</span>
1075
+ <span class='kw'>end</span>
1076
+ <span class='kw'>rescue</span> <span class='const'>EOFError</span>
1077
+ <span class='kw'>rescue</span> <span class='const'>IOError</span>
1078
+ <span class='kw'>ensure</span>
1079
+ <span class='ivar'>@match_listener</span> <span class='op'>=</span> <span class='kw'>nil</span>
1080
+ <span class='kw'>end</span>
1081
+ <span class='kw'>end</span>
1082
+ <span class='kw'>end</span></pre>
1083
+ </td>
1084
+ </tr>
1085
+ </table>
1086
+ </div>
1087
+
1088
+ <div class="method_details ">
1089
+ <h3 class="signature " id="unregister_observer-instance_method">
1090
+
1091
+ - (<tt>Object</tt>) <strong>unregister_observer</strong>(&amp;block)
1092
+
1093
+
1094
+
1095
+
1096
+
1097
+ </h3><div class="docstring">
1098
+ <div class="discussion">
1099
+
1100
+ <p>Unregister a block from being called when matched data is received.</p>
1101
+
1102
+
1103
+ </div>
1104
+ </div>
1105
+ <div class="tags">
1106
+
1107
+
1108
+ </div><table class="source_code">
1109
+ <tr>
1110
+ <td>
1111
+ <pre class="lines">
1112
+
1113
+
1114
+ 174
1115
+ 175
1116
+ 176
1117
+ 177</pre>
1118
+ </td>
1119
+ <td>
1120
+ <pre class="code"><span class="info file"># File 'lib/ionian/extension/io.rb', line 174</span>
1121
+
1122
+ <span class='kw'>def</span> <span class='id identifier rubyid_unregister_observer'>unregister_observer</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
1123
+ <span class='ivar'>@ionian_listeners</span><span class='period'>.</span><span class='id identifier rubyid_delete_if'>delete_if</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_o'>o</span><span class='op'>|</span> <span class='id identifier rubyid_o'>o</span> <span class='op'>==</span> <span class='id identifier rubyid_block'>block</span><span class='rbrace'>}</span>
1124
+ <span class='id identifier rubyid_block'>block</span>
1125
+ <span class='kw'>end</span></pre>
1126
+ </td>
1127
+ </tr>
1128
+ </table>
1129
+ </div>
1130
+
1131
+ </div>
1132
+
1133
+ </div>
1134
+
1135
+ <div id="footer">
1136
+ Generated on Sat Mar 15 21:04:53 2014 by
1137
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1138
+ 0.8.7.3 (ruby-2.1.1).
1139
+ </div>
679
1140
 
1141
+ </body>
1142
+ </html>