bridge-ruby 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +19 -0
- data/README.md +31 -0
- data/Rakefile +24 -0
- data/bridge-ruby.gemspec +24 -0
- data/doc/Bridge.html +276 -0
- data/doc/Bridge/Bridge.html +1874 -0
- data/doc/Bridge/Bridge/SystemService.html +396 -0
- data/doc/Bridge/Client.html +271 -0
- data/doc/Bridge/Connection.html +1180 -0
- data/doc/Bridge/Connection/SockBuffer.html +322 -0
- data/doc/Bridge/Reference.html +605 -0
- data/doc/Bridge/Serializer.html +405 -0
- data/doc/Bridge/Serializer/Callback.html +498 -0
- data/doc/Bridge/Tcp.html +657 -0
- data/doc/Bridge/Util.html +643 -0
- data/doc/Bridge/Util/CallbackReference.html +557 -0
- data/doc/OpenSSL/X509/Certificate.html +275 -0
- data/doc/SSLCertificateVerification.html +446 -0
- data/doc/_index.html +239 -0
- data/doc/class_list.html +53 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +57 -0
- data/doc/css/style.css +328 -0
- data/doc/file.README.html +106 -0
- data/doc/file_list.html +55 -0
- data/doc/frames.html +28 -0
- data/doc/index.html +106 -0
- data/doc/js/app.js +214 -0
- data/doc/js/full_list.js +173 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +772 -0
- data/doc/top-level-namespace.html +112 -0
- data/examples/channels/client-writeable.rb +24 -0
- data/examples/channels/client.rb +23 -0
- data/examples/channels/server.rb +24 -0
- data/examples/chat/chatclient.rb +21 -0
- data/examples/chat/chatserver.rb +24 -0
- data/examples/client-context/client.rb +21 -0
- data/examples/client-context/server.rb +25 -0
- data/examples/secure/example.rb +8 -0
- data/examples/simple/channels.rb +47 -0
- data/examples/simple/services.rb +41 -0
- data/include/ssl/cacert.pem +3331 -0
- data/lib/bridge-ruby.rb +441 -0
- data/lib/client.rb +14 -0
- data/lib/connection.rb +162 -0
- data/lib/reference.rb +49 -0
- data/lib/serializer.rb +104 -0
- data/lib/ssl_utils.rb +68 -0
- data/lib/tcp.rb +73 -0
- data/lib/util.rb +101 -0
- data/lib/version.rb +3 -0
- data/rakelib/package.rake +4 -0
- data/rakelib/test.rake +8 -0
- data/test/regression/reconnect.rb +48 -0
- data/test/regression/rpc.rb +39 -0
- data/test/regression/test.rb +58 -0
- data/test/unit/bridge_dummy.rb +26 -0
- data/test/unit/connection_dummy.rb +21 -0
- data/test/unit/reference_dummy.rb +11 -0
- data/test/unit/tcp_dummy.rb +12 -0
- data/test/unit/test.rb +20 -0
- data/test/unit/test_reference.rb +30 -0
- data/test/unit/test_serializer.rb +109 -0
- data/test/unit/test_tcp.rb +51 -0
- data/test/unit/test_util.rb +59 -0
- metadata +162 -0
@@ -0,0 +1,643 @@
|
|
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: Bridge::Util
|
8
|
+
|
9
|
+
— Documentation by YARD 0.8.2.1
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" media="screen" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" media="screen" charset="utf-8" />
|
16
|
+
|
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);
|
21
|
+
</script>
|
22
|
+
|
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 (U)</a> »
|
35
|
+
<span class='title'><span class='object_link'><a href="../Bridge.html" title="Bridge (module)">Bridge</a></span></span>
|
36
|
+
»
|
37
|
+
<span class="title">Util</span>
|
38
|
+
|
39
|
+
|
40
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
41
|
+
</div>
|
42
|
+
|
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>
|
62
|
+
</div>
|
63
|
+
|
64
|
+
<iframe id="search_frame"></iframe>
|
65
|
+
|
66
|
+
<div id="content"><h1>Module: Bridge::Util
|
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/util.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>:nodoc: all</p>
|
91
|
+
|
92
|
+
|
93
|
+
</div>
|
94
|
+
</div>
|
95
|
+
<div class="tags">
|
96
|
+
|
97
|
+
|
98
|
+
</div><h2>Defined Under Namespace</h2>
|
99
|
+
<p class="children">
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
<strong class="classes">Classes:</strong> <span class='object_link'><a href="Util/CallbackReference.html" title="Bridge::Util::CallbackReference (class)">CallbackReference</a></span>
|
105
|
+
|
106
|
+
|
107
|
+
</p>
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
<h2>
|
117
|
+
Class Method Summary
|
118
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
119
|
+
</h2>
|
120
|
+
|
121
|
+
<ul class="summary">
|
122
|
+
|
123
|
+
<li class="public ">
|
124
|
+
<span class="summary_signature">
|
125
|
+
|
126
|
+
<a href="#error-class_method" title="error (class method)">+ (Object) <strong>error</strong>(msg) </a>
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
</span>
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
141
|
+
|
142
|
+
</li>
|
143
|
+
|
144
|
+
|
145
|
+
<li class="public ">
|
146
|
+
<span class="summary_signature">
|
147
|
+
|
148
|
+
<a href="#find_ops-class_method" title="find_ops (class method)">+ (Object) <strong>find_ops</strong>(obj) </a>
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
</span>
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
|
162
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
163
|
+
|
164
|
+
</li>
|
165
|
+
|
166
|
+
|
167
|
+
<li class="public ">
|
168
|
+
<span class="summary_signature">
|
169
|
+
|
170
|
+
<a href="#generate_guid-class_method" title="generate_guid (class method)">+ (Object) <strong>generate_guid</strong> </a>
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
</span>
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
|
184
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
185
|
+
|
186
|
+
</li>
|
187
|
+
|
188
|
+
|
189
|
+
<li class="public ">
|
190
|
+
<span class="summary_signature">
|
191
|
+
|
192
|
+
<a href="#info-class_method" title="info (class method)">+ (Object) <strong>info</strong>(msg) </a>
|
193
|
+
|
194
|
+
|
195
|
+
|
196
|
+
</span>
|
197
|
+
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
|
206
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
207
|
+
|
208
|
+
</li>
|
209
|
+
|
210
|
+
|
211
|
+
<li class="public ">
|
212
|
+
<span class="summary_signature">
|
213
|
+
|
214
|
+
<a href="#parse-class_method" title="parse (class method)">+ (Object) <strong>parse</strong>(str) </a>
|
215
|
+
|
216
|
+
|
217
|
+
|
218
|
+
</span>
|
219
|
+
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
|
226
|
+
|
227
|
+
|
228
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
229
|
+
|
230
|
+
</li>
|
231
|
+
|
232
|
+
|
233
|
+
<li class="public ">
|
234
|
+
<span class="summary_signature">
|
235
|
+
|
236
|
+
<a href="#ref_callback-class_method" title="ref_callback (class method)">+ (Object) <strong>ref_callback</strong>(ref) </a>
|
237
|
+
|
238
|
+
|
239
|
+
|
240
|
+
</span>
|
241
|
+
|
242
|
+
|
243
|
+
|
244
|
+
|
245
|
+
|
246
|
+
|
247
|
+
|
248
|
+
|
249
|
+
|
250
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
251
|
+
|
252
|
+
</li>
|
253
|
+
|
254
|
+
|
255
|
+
<li class="public ">
|
256
|
+
<span class="summary_signature">
|
257
|
+
|
258
|
+
<a href="#set_log_level-class_method" title="set_log_level (class method)">+ (Object) <strong>set_log_level</strong>(level) </a>
|
259
|
+
|
260
|
+
|
261
|
+
|
262
|
+
</span>
|
263
|
+
|
264
|
+
|
265
|
+
|
266
|
+
|
267
|
+
|
268
|
+
|
269
|
+
|
270
|
+
|
271
|
+
|
272
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
273
|
+
|
274
|
+
</li>
|
275
|
+
|
276
|
+
|
277
|
+
<li class="public ">
|
278
|
+
<span class="summary_signature">
|
279
|
+
|
280
|
+
<a href="#stringify-class_method" title="stringify (class method)">+ (Object) <strong>stringify</strong>(obj) </a>
|
281
|
+
|
282
|
+
|
283
|
+
|
284
|
+
</span>
|
285
|
+
|
286
|
+
|
287
|
+
|
288
|
+
|
289
|
+
|
290
|
+
|
291
|
+
|
292
|
+
|
293
|
+
|
294
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
295
|
+
|
296
|
+
</li>
|
297
|
+
|
298
|
+
|
299
|
+
<li class="public ">
|
300
|
+
<span class="summary_signature">
|
301
|
+
|
302
|
+
<a href="#warn-class_method" title="warn (class method)">+ (Object) <strong>warn</strong>(msg) </a>
|
303
|
+
|
304
|
+
|
305
|
+
|
306
|
+
</span>
|
307
|
+
|
308
|
+
|
309
|
+
|
310
|
+
|
311
|
+
|
312
|
+
|
313
|
+
|
314
|
+
|
315
|
+
|
316
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
317
|
+
|
318
|
+
</li>
|
319
|
+
|
320
|
+
|
321
|
+
</ul>
|
322
|
+
|
323
|
+
|
324
|
+
|
325
|
+
|
326
|
+
<div id="class_method_details" class="method_details_list">
|
327
|
+
<h2>Class Method Details</h2>
|
328
|
+
|
329
|
+
|
330
|
+
<div class="method_details first">
|
331
|
+
<h3 class="signature first" id="error-class_method">
|
332
|
+
|
333
|
+
+ (<tt>Object</tt>) <strong>error</strong>(msg)
|
334
|
+
|
335
|
+
|
336
|
+
|
337
|
+
|
338
|
+
|
339
|
+
</h3><table class="source_code">
|
340
|
+
<tr>
|
341
|
+
<td>
|
342
|
+
<pre class="lines">
|
343
|
+
|
344
|
+
|
345
|
+
32
|
346
|
+
33
|
347
|
+
34</pre>
|
348
|
+
</td>
|
349
|
+
<td>
|
350
|
+
<pre class="code"><span class="info file"># File 'lib/util.rb', line 32</span>
|
351
|
+
|
352
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_error'>error</span> <span class='id identifier rubyid_msg'>msg</span>
|
353
|
+
<span class='ivar'>@log</span><span class='period'>.</span><span class='id identifier rubyid_error'>error</span> <span class='id identifier rubyid_msg'>msg</span>
|
354
|
+
<span class='kw'>end</span></pre>
|
355
|
+
</td>
|
356
|
+
</tr>
|
357
|
+
</table>
|
358
|
+
</div>
|
359
|
+
|
360
|
+
<div class="method_details ">
|
361
|
+
<h3 class="signature " id="find_ops-class_method">
|
362
|
+
|
363
|
+
+ (<tt>Object</tt>) <strong>find_ops</strong>(obj)
|
364
|
+
|
365
|
+
|
366
|
+
|
367
|
+
|
368
|
+
|
369
|
+
</h3><table class="source_code">
|
370
|
+
<tr>
|
371
|
+
<td>
|
372
|
+
<pre class="lines">
|
373
|
+
|
374
|
+
|
375
|
+
55
|
376
|
+
56
|
377
|
+
57
|
378
|
+
58
|
379
|
+
59
|
380
|
+
60
|
381
|
+
61</pre>
|
382
|
+
</td>
|
383
|
+
<td>
|
384
|
+
<pre class="code"><span class="info file"># File 'lib/util.rb', line 55</span>
|
385
|
+
|
386
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_find_ops'>find_ops</span> <span class='id identifier rubyid_obj'>obj</span>
|
387
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_obj'>obj</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span> <span class='const'>Module</span>
|
388
|
+
<span class='kw'>return</span> <span class='id identifier rubyid_obj'>obj</span><span class='period'>.</span><span class='id identifier rubyid_methods'>methods</span> <span class='kw'>false</span>
|
389
|
+
<span class='kw'>else</span>
|
390
|
+
<span class='kw'>return</span> <span class='id identifier rubyid_obj'>obj</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_instance_methods'>instance_methods</span> <span class='kw'>false</span>
|
391
|
+
<span class='kw'>end</span>
|
392
|
+
<span class='kw'>end</span></pre>
|
393
|
+
</td>
|
394
|
+
</tr>
|
395
|
+
</table>
|
396
|
+
</div>
|
397
|
+
|
398
|
+
<div class="method_details ">
|
399
|
+
<h3 class="signature " id="generate_guid-class_method">
|
400
|
+
|
401
|
+
+ (<tt>Object</tt>) <strong>generate_guid</strong>
|
402
|
+
|
403
|
+
|
404
|
+
|
405
|
+
|
406
|
+
|
407
|
+
</h3><table class="source_code">
|
408
|
+
<tr>
|
409
|
+
<td>
|
410
|
+
<pre class="lines">
|
411
|
+
|
412
|
+
|
413
|
+
11
|
414
|
+
12
|
415
|
+
13
|
416
|
+
14</pre>
|
417
|
+
</td>
|
418
|
+
<td>
|
419
|
+
<pre class="code"><span class="info file"># File 'lib/util.rb', line 11</span>
|
420
|
+
|
421
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_generate_guid'>generate_guid</span>
|
422
|
+
<span class='id identifier rubyid_chars'>chars</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>a</span><span class='tstring_end'>'</span></span><span class='op'>..</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>z</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_a'>to_a</span> <span class='op'>+</span> <span class='lparen'>(</span><span class='int'>0</span><span class='op'>..</span><span class='int'>9</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_a'>to_a</span><span class='rparen'>)</span>
|
423
|
+
<span class='lparen'>(</span><span class='int'>0</span><span class='op'>...</span><span class='int'>12</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lbrace'>{</span> <span class='id identifier rubyid_chars'>chars</span><span class='lbracket'>[</span><span class='id identifier rubyid_rand'>rand</span><span class='lparen'>(</span><span class='int'>26</span><span class='rparen'>)</span><span class='rbracket'>]</span> <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span>
|
424
|
+
<span class='kw'>end</span></pre>
|
425
|
+
</td>
|
426
|
+
</tr>
|
427
|
+
</table>
|
428
|
+
</div>
|
429
|
+
|
430
|
+
<div class="method_details ">
|
431
|
+
<h3 class="signature " id="info-class_method">
|
432
|
+
|
433
|
+
+ (<tt>Object</tt>) <strong>info</strong>(msg)
|
434
|
+
|
435
|
+
|
436
|
+
|
437
|
+
|
438
|
+
|
439
|
+
</h3><table class="source_code">
|
440
|
+
<tr>
|
441
|
+
<td>
|
442
|
+
<pre class="lines">
|
443
|
+
|
444
|
+
|
445
|
+
24
|
446
|
+
25
|
447
|
+
26</pre>
|
448
|
+
</td>
|
449
|
+
<td>
|
450
|
+
<pre class="code"><span class="info file"># File 'lib/util.rb', line 24</span>
|
451
|
+
|
452
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_info'>info</span> <span class='id identifier rubyid_msg'>msg</span>
|
453
|
+
<span class='ivar'>@log</span><span class='period'>.</span><span class='id identifier rubyid_info'>info</span> <span class='id identifier rubyid_msg'>msg</span>
|
454
|
+
<span class='kw'>end</span></pre>
|
455
|
+
</td>
|
456
|
+
</tr>
|
457
|
+
</table>
|
458
|
+
</div>
|
459
|
+
|
460
|
+
<div class="method_details ">
|
461
|
+
<h3 class="signature " id="parse-class_method">
|
462
|
+
|
463
|
+
+ (<tt>Object</tt>) <strong>parse</strong>(str)
|
464
|
+
|
465
|
+
|
466
|
+
|
467
|
+
|
468
|
+
|
469
|
+
</h3><table class="source_code">
|
470
|
+
<tr>
|
471
|
+
<td>
|
472
|
+
<pre class="lines">
|
473
|
+
|
474
|
+
|
475
|
+
20
|
476
|
+
21
|
477
|
+
22</pre>
|
478
|
+
</td>
|
479
|
+
<td>
|
480
|
+
<pre class="code"><span class="info file"># File 'lib/util.rb', line 20</span>
|
481
|
+
|
482
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_parse'>parse</span> <span class='id identifier rubyid_str'>str</span>
|
483
|
+
<span class='const'>JSON</span><span class='op'>::</span><span class='id identifier rubyid_parse'>parse</span> <span class='id identifier rubyid_str'>str</span>
|
484
|
+
<span class='kw'>end</span></pre>
|
485
|
+
</td>
|
486
|
+
</tr>
|
487
|
+
</table>
|
488
|
+
</div>
|
489
|
+
|
490
|
+
<div class="method_details ">
|
491
|
+
<h3 class="signature " id="ref_callback-class_method">
|
492
|
+
|
493
|
+
+ (<tt>Object</tt>) <strong>ref_callback</strong>(ref)
|
494
|
+
|
495
|
+
|
496
|
+
|
497
|
+
|
498
|
+
|
499
|
+
</h3><table class="source_code">
|
500
|
+
<tr>
|
501
|
+
<td>
|
502
|
+
<pre class="lines">
|
503
|
+
|
504
|
+
|
505
|
+
48
|
506
|
+
49
|
507
|
+
50
|
508
|
+
51
|
509
|
+
52
|
510
|
+
53</pre>
|
511
|
+
</td>
|
512
|
+
<td>
|
513
|
+
<pre class="code"><span class="info file"># File 'lib/util.rb', line 48</span>
|
514
|
+
|
515
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_ref_callback'>ref_callback</span> <span class='id identifier rubyid_ref'>ref</span>
|
516
|
+
<span class='const'>CallbackReference</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='id identifier rubyid_ref'>ref</span> <span class='kw'>do</span> <span class='op'>|</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_blk'>blk</span><span class='op'>|</span>
|
517
|
+
<span class='id identifier rubyid_args'>args</span> <span class='op'><<</span> <span class='id identifier rubyid_blk'>blk</span> <span class='kw'>if</span> <span class='id identifier rubyid_blk'>blk</span>
|
518
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span>
|
519
|
+
<span class='kw'>end</span>
|
520
|
+
<span class='kw'>end</span></pre>
|
521
|
+
</td>
|
522
|
+
</tr>
|
523
|
+
</table>
|
524
|
+
</div>
|
525
|
+
|
526
|
+
<div class="method_details ">
|
527
|
+
<h3 class="signature " id="set_log_level-class_method">
|
528
|
+
|
529
|
+
+ (<tt>Object</tt>) <strong>set_log_level</strong>(level)
|
530
|
+
|
531
|
+
|
532
|
+
|
533
|
+
|
534
|
+
|
535
|
+
</h3><table class="source_code">
|
536
|
+
<tr>
|
537
|
+
<td>
|
538
|
+
<pre class="lines">
|
539
|
+
|
540
|
+
|
541
|
+
36
|
542
|
+
37
|
543
|
+
38
|
544
|
+
39
|
545
|
+
40
|
546
|
+
41
|
547
|
+
42
|
548
|
+
43
|
549
|
+
44
|
550
|
+
45
|
551
|
+
46</pre>
|
552
|
+
</td>
|
553
|
+
<td>
|
554
|
+
<pre class="code"><span class="info file"># File 'lib/util.rb', line 36</span>
|
555
|
+
|
556
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_set_log_level'>set_log_level</span> <span class='id identifier rubyid_level'>level</span>
|
557
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_level'>level</span> <span class='op'>></span> <span class='int'>2</span>
|
558
|
+
<span class='ivar'>@log</span><span class='period'>.</span><span class='id identifier rubyid_level'>level</span> <span class='op'>=</span> <span class='const'>Logger</span><span class='op'>::</span><span class='const'>INFO</span>
|
559
|
+
<span class='kw'>elsif</span> <span class='id identifier rubyid_level'>level</span> <span class='op'>==</span> <span class='int'>2</span>
|
560
|
+
<span class='ivar'>@log</span><span class='period'>.</span><span class='id identifier rubyid_level'>level</span> <span class='op'>=</span> <span class='const'>Logger</span><span class='op'>::</span><span class='const'>WARN</span>
|
561
|
+
<span class='kw'>elsif</span> <span class='id identifier rubyid_level'>level</span> <span class='op'>==</span> <span class='int'>1</span>
|
562
|
+
<span class='ivar'>@log</span><span class='period'>.</span><span class='id identifier rubyid_level'>level</span> <span class='op'>=</span> <span class='const'>Logger</span><span class='op'>::</span><span class='const'>ERROR</span>
|
563
|
+
<span class='kw'>else</span>
|
564
|
+
<span class='ivar'>@log</span><span class='period'>.</span><span class='id identifier rubyid_level'>level</span> <span class='op'>=</span> <span class='const'>Logger</span><span class='op'>::</span><span class='const'>FATAL</span>
|
565
|
+
<span class='kw'>end</span>
|
566
|
+
<span class='kw'>end</span></pre>
|
567
|
+
</td>
|
568
|
+
</tr>
|
569
|
+
</table>
|
570
|
+
</div>
|
571
|
+
|
572
|
+
<div class="method_details ">
|
573
|
+
<h3 class="signature " id="stringify-class_method">
|
574
|
+
|
575
|
+
+ (<tt>Object</tt>) <strong>stringify</strong>(obj)
|
576
|
+
|
577
|
+
|
578
|
+
|
579
|
+
|
580
|
+
|
581
|
+
</h3><table class="source_code">
|
582
|
+
<tr>
|
583
|
+
<td>
|
584
|
+
<pre class="lines">
|
585
|
+
|
586
|
+
|
587
|
+
16
|
588
|
+
17
|
589
|
+
18</pre>
|
590
|
+
</td>
|
591
|
+
<td>
|
592
|
+
<pre class="code"><span class="info file"># File 'lib/util.rb', line 16</span>
|
593
|
+
|
594
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_stringify'>stringify</span> <span class='id identifier rubyid_obj'>obj</span>
|
595
|
+
<span class='const'>JSON</span><span class='op'>::</span><span class='id identifier rubyid_generate'>generate</span> <span class='id identifier rubyid_obj'>obj</span>
|
596
|
+
<span class='kw'>end</span></pre>
|
597
|
+
</td>
|
598
|
+
</tr>
|
599
|
+
</table>
|
600
|
+
</div>
|
601
|
+
|
602
|
+
<div class="method_details ">
|
603
|
+
<h3 class="signature " id="warn-class_method">
|
604
|
+
|
605
|
+
+ (<tt>Object</tt>) <strong>warn</strong>(msg)
|
606
|
+
|
607
|
+
|
608
|
+
|
609
|
+
|
610
|
+
|
611
|
+
</h3><table class="source_code">
|
612
|
+
<tr>
|
613
|
+
<td>
|
614
|
+
<pre class="lines">
|
615
|
+
|
616
|
+
|
617
|
+
28
|
618
|
+
29
|
619
|
+
30</pre>
|
620
|
+
</td>
|
621
|
+
<td>
|
622
|
+
<pre class="code"><span class="info file"># File 'lib/util.rb', line 28</span>
|
623
|
+
|
624
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_warn'>warn</span> <span class='id identifier rubyid_msg'>msg</span>
|
625
|
+
<span class='ivar'>@log</span><span class='period'>.</span><span class='id identifier rubyid_warn'>warn</span> <span class='id identifier rubyid_msg'>msg</span>
|
626
|
+
<span class='kw'>end</span></pre>
|
627
|
+
</td>
|
628
|
+
</tr>
|
629
|
+
</table>
|
630
|
+
</div>
|
631
|
+
|
632
|
+
</div>
|
633
|
+
|
634
|
+
</div>
|
635
|
+
|
636
|
+
<div id="footer">
|
637
|
+
Generated on Wed Jun 20 11:00:11 2012 by
|
638
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
639
|
+
0.8.2.1 (ruby-1.9.3).
|
640
|
+
</div>
|
641
|
+
|
642
|
+
</body>
|
643
|
+
</html>
|