flotype-bridge 0.1.0.beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +6 -0
- data/Rakefile +24 -0
- data/doc/Bridge.html +954 -0
- data/doc/Bridge/Callback.html +495 -0
- data/doc/Bridge/CallbackRef.html +343 -0
- data/doc/Bridge/Conn.html +409 -0
- data/doc/Bridge/Core.html +762 -0
- data/doc/Bridge/LocalRef.html +509 -0
- data/doc/Bridge/Ref.html +647 -0
- data/doc/Bridge/Service.html +135 -0
- data/doc/Bridge/Sys.html +278 -0
- data/doc/Bridge/Util.html +746 -0
- data/doc/_index.html +202 -0
- data/doc/class_list.html +47 -0
- data/doc/classes/Bridge.html +263 -0
- data/doc/classes/Bridge.src/M000001.html +24 -0
- data/doc/classes/Bridge.src/M000002.html +18 -0
- data/doc/classes/Bridge.src/M000003.html +18 -0
- data/doc/classes/Bridge.src/M000004.html +20 -0
- data/doc/classes/Bridge.src/M000005.html +26 -0
- data/doc/classes/Bridge.src/M000006.html +22 -0
- data/doc/classes/Bridge.src/M000007.html +18 -0
- data/doc/classes/Bridge.src/M000008.html +18 -0
- data/doc/created.rid +1 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +55 -0
- data/doc/css/style.css +322 -0
- data/doc/file.README.html +71 -0
- data/doc/file_list.html +49 -0
- data/doc/files/lib/bridge_rb.html +108 -0
- data/doc/fr_class_index.html +27 -0
- data/doc/fr_file_index.html +27 -0
- data/doc/fr_method_index.html +34 -0
- data/doc/frames.html +13 -0
- data/doc/index.html +71 -0
- data/doc/js/app.js +205 -0
- data/doc/js/full_list.js +173 -0
- data/doc/js/jquery.js +16 -0
- data/doc/method_list.html +510 -0
- data/doc/rdoc-style.css +208 -0
- data/doc/top-level-namespace.html +105 -0
- data/examples/chat/chat_client.rb +41 -0
- data/examples/chat/chat_server.rb +24 -0
- data/examples/pong/pong.rb +29 -0
- data/flotype-bridge.gemspec +24 -0
- data/lib/bb/callback.rb +33 -0
- data/lib/bb/conn.rb +31 -0
- data/lib/bb/core.rb +109 -0
- data/lib/bb/localref.rb +37 -0
- data/lib/bb/ref.rb +49 -0
- data/lib/bb/svc.rb +7 -0
- data/lib/bb/sys.rb +17 -0
- data/lib/bb/util.rb +93 -0
- data/lib/bb/version.rb +3 -0
- data/lib/bridge.rb +130 -0
- data/rakelib/package.rake +4 -0
- data/rakelib/test.rake +8 -0
- data/tests/bb_test_helper.rb +3 -0
- data/tests/test_serialize.rb +4 -0
- metadata +196 -0
@@ -0,0 +1,135 @@
|
|
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::Service
|
8
|
+
|
9
|
+
— Documentation by YARD 0.7.5
|
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
|
+
relpath = '..';
|
19
|
+
if (relpath != '') relpath += '/';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
23
|
+
|
24
|
+
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
25
|
+
|
26
|
+
|
27
|
+
</head>
|
28
|
+
<body>
|
29
|
+
<script type="text/javascript" charset="utf-8">
|
30
|
+
if (window.top.frames.main) document.body.className = 'frames';
|
31
|
+
</script>
|
32
|
+
|
33
|
+
<div id="header">
|
34
|
+
<div id="menu">
|
35
|
+
|
36
|
+
<a href="../_index.html">Index (S)</a> »
|
37
|
+
<span class='title'><span class='object_link'><a href="../Bridge.html" title="Bridge (module)">Bridge</a></span></span>
|
38
|
+
»
|
39
|
+
<span class="title">Service</span>
|
40
|
+
|
41
|
+
|
42
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
43
|
+
</div>
|
44
|
+
|
45
|
+
<div id="search">
|
46
|
+
|
47
|
+
<a id="class_list_link" href="#">Class List</a>
|
48
|
+
|
49
|
+
<a id="method_list_link" href="#">Method List</a>
|
50
|
+
|
51
|
+
<a id="file_list_link" href="#">File List</a>
|
52
|
+
|
53
|
+
</div>
|
54
|
+
<div class="clear"></div>
|
55
|
+
</div>
|
56
|
+
|
57
|
+
<iframe id="search_frame"></iframe>
|
58
|
+
|
59
|
+
<div id="content"><h1>Module: Bridge::Service
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
</h1>
|
64
|
+
|
65
|
+
<dl class="box">
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
<dt class="r1">Includes:</dt>
|
72
|
+
<dd class="r1"><span class='object_link'><a href="../Bridge.html" title="Bridge (module)">Bridge</a></span></dd>
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
<dt class="r2 last">Defined in:</dt>
|
79
|
+
<dd class="r2 last">lib/bb/svc.rb</dd>
|
80
|
+
|
81
|
+
</dl>
|
82
|
+
<div class="clear"></div>
|
83
|
+
|
84
|
+
<h2>Overview</h2><div class="docstring">
|
85
|
+
<div class="discussion">
|
86
|
+
<p>
|
87
|
+
Wrapper for user-defined Bridge Services. All services passed in as
|
88
|
+
arguments must include this module in order to be detected and serialized
|
89
|
+
correctly.
|
90
|
+
</p>
|
91
|
+
|
92
|
+
|
93
|
+
</div>
|
94
|
+
</div>
|
95
|
+
<div class="tags">
|
96
|
+
|
97
|
+
|
98
|
+
</div>
|
99
|
+
<h2>Constant Summary</h2>
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
<h2>Constant Summary</h2>
|
105
|
+
|
106
|
+
<h3 class="inherited">Constants included
|
107
|
+
from <span class='object_link'><a href="../Bridge.html" title="Bridge (module)">Bridge</a></span></h3>
|
108
|
+
<p class="inherited"><span class='object_link'><a href="../Bridge.html#VERSION-constant" title="Bridge::VERSION (constant)">VERSION</a></span></p>
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
<h2>Method Summary</h2>
|
121
|
+
|
122
|
+
<h3 class="inherited">Methods included from <span class='object_link'><a href="../Bridge.html" title="Bridge (module)">Bridge</a></span></h3>
|
123
|
+
<p class="inherited"><span class='object_link'><a href="../Bridge.html#client_id-class_method" title="Bridge.client_id (method)">client_id</a></span>, <span class='object_link'><a href="../Bridge.html#get_channel-class_method" title="Bridge.get_channel (method)">get_channel</a></span>, <span class='object_link'><a href="../Bridge.html#get_service-class_method" title="Bridge.get_service (method)">get_service</a></span>, <span class='object_link'><a href="../Bridge.html#initialize-class_method" title="Bridge.initialize (method)">initialize</a></span>, <span class='object_link'><a href="../Bridge.html#join_channel-class_method" title="Bridge.join_channel (method)">join_channel</a></span>, <span class='object_link'><a href="../Bridge.html#leave_channel-class_method" title="Bridge.leave_channel (method)">leave_channel</a></span>, <span class='object_link'><a href="../Bridge.html#options-class_method" title="Bridge.options (method)">options</a></span>, <span class='object_link'><a href="../Bridge.html#publish_service-class_method" title="Bridge.publish_service (method)">publish_service</a></span>, <span class='object_link'><a href="../Bridge.html#ready-class_method" title="Bridge.ready (method)">ready</a></span>, <span class='object_link'><a href="../Bridge.html#send-class_method" title="Bridge.send (method)">send</a></span></p>
|
124
|
+
|
125
|
+
|
126
|
+
</div>
|
127
|
+
|
128
|
+
<div id="footer">
|
129
|
+
Generated on Sun Mar 4 11:14:11 2012 by
|
130
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
131
|
+
0.7.5 (ruby-1.8.7).
|
132
|
+
</div>
|
133
|
+
|
134
|
+
</body>
|
135
|
+
</html>
|
data/doc/Bridge/Sys.html
ADDED
@@ -0,0 +1,278 @@
|
|
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::Sys
|
8
|
+
|
9
|
+
— Documentation by YARD 0.7.5
|
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
|
+
relpath = '..';
|
19
|
+
if (relpath != '') relpath += '/';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
23
|
+
|
24
|
+
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
25
|
+
|
26
|
+
|
27
|
+
</head>
|
28
|
+
<body>
|
29
|
+
<script type="text/javascript" charset="utf-8">
|
30
|
+
if (window.top.frames.main) document.body.className = 'frames';
|
31
|
+
</script>
|
32
|
+
|
33
|
+
<div id="header">
|
34
|
+
<div id="menu">
|
35
|
+
|
36
|
+
<a href="../_index.html">Index (S)</a> »
|
37
|
+
<span class='title'><span class='object_link'><a href="../Bridge.html" title="Bridge (module)">Bridge</a></span></span>
|
38
|
+
»
|
39
|
+
<span class="title">Sys</span>
|
40
|
+
|
41
|
+
|
42
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
43
|
+
</div>
|
44
|
+
|
45
|
+
<div id="search">
|
46
|
+
|
47
|
+
<a id="class_list_link" href="#">Class List</a>
|
48
|
+
|
49
|
+
<a id="method_list_link" href="#">Method List</a>
|
50
|
+
|
51
|
+
<a id="file_list_link" href="#">File List</a>
|
52
|
+
|
53
|
+
</div>
|
54
|
+
<div class="clear"></div>
|
55
|
+
</div>
|
56
|
+
|
57
|
+
<iframe id="search_frame"></iframe>
|
58
|
+
|
59
|
+
<div id="content"><h1>Module: Bridge::Sys
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
</h1>
|
64
|
+
|
65
|
+
<dl class="box">
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
<dt class="r1 last">Defined in:</dt>
|
75
|
+
<dd class="r1 last">lib/bb/sys.rb</dd>
|
76
|
+
|
77
|
+
</dl>
|
78
|
+
<div class="clear"></div>
|
79
|
+
|
80
|
+
<h2>Overview</h2><div class="docstring">
|
81
|
+
<div class="discussion">
|
82
|
+
<p>
|
83
|
+
These are internal system functions, which should only be called by the
|
84
|
+
Erlang gateway.
|
85
|
+
</p>
|
86
|
+
|
87
|
+
|
88
|
+
</div>
|
89
|
+
</div>
|
90
|
+
<div class="tags">
|
91
|
+
|
92
|
+
|
93
|
+
</div>
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
<h2>
|
102
|
+
Class Method Summary
|
103
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
104
|
+
</h2>
|
105
|
+
|
106
|
+
<ul class="summary">
|
107
|
+
|
108
|
+
<li class="public ">
|
109
|
+
<span class="summary_signature">
|
110
|
+
|
111
|
+
<a href="#get_service-class_method" title="get_service (class method)">+ (Object) <strong>get_service</strong>(name, fun) </a>
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
</span>
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
125
|
+
|
126
|
+
</li>
|
127
|
+
|
128
|
+
|
129
|
+
<li class="public ">
|
130
|
+
<span class="summary_signature">
|
131
|
+
|
132
|
+
<a href="#hook_channel_handler-class_method" title="hook_channel_handler (class method)">+ (Object) <strong>hook_channel_handler</strong>(name, handler, fun) </a>
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
</span>
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
146
|
+
|
147
|
+
</li>
|
148
|
+
|
149
|
+
|
150
|
+
<li class="public ">
|
151
|
+
<span class="summary_signature">
|
152
|
+
|
153
|
+
<a href="#remoteError-class_method" title="remoteError (class method)">+ (Object) <strong>remoteError</strong>(msg) </a>
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
</span>
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
167
|
+
|
168
|
+
</li>
|
169
|
+
|
170
|
+
|
171
|
+
</ul>
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
<div id="class_method_details" class="method_details_list">
|
177
|
+
<h2>Class Method Details</h2>
|
178
|
+
|
179
|
+
|
180
|
+
<div class="method_details first">
|
181
|
+
<p class="signature first" id="get_service-class_method">
|
182
|
+
|
183
|
+
+ (<tt>Object</tt>) <strong>get_service</strong>(name, fun)
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
</p><table class="source_code">
|
188
|
+
<tr>
|
189
|
+
<td>
|
190
|
+
<pre class="lines">
|
191
|
+
|
192
|
+
|
193
|
+
13
|
194
|
+
14
|
195
|
+
15</pre>
|
196
|
+
</td>
|
197
|
+
<td>
|
198
|
+
<pre class="code"><span class="info file"># File 'lib/bb/sys.rb', line 13</span>
|
199
|
+
|
200
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_get_service identifier id'>get_service</span> <span class='rubyid_name identifier id'>name</span><span class='comma token'>,</span> <span class='rubyid_fun identifier id'>fun</span>
|
201
|
+
<span class='rubyid_fun identifier id'>fun</span><span class='dot token'>.</span><span class='rubyid_call identifier id'>call</span><span class='lparen token'>(</span><span class='rubyid_Core constant id'>Core</span><span class='colon2 op'>::</span><span class='rubyid_lookup identifier id'>lookup</span><span class='lparen token'>(</span><span class='rubyid_name identifier id'>name</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='rubyid_methods identifier id'>methods</span><span class='lparen token'>(</span><span class='rubyid_false false kw'>false</span><span class='rparen token'>)</span><span class='rparen token'>)</span>
|
202
|
+
<span class='rubyid_end end kw'>end</span>
|
203
|
+
</pre>
|
204
|
+
</td>
|
205
|
+
</tr>
|
206
|
+
</table>
|
207
|
+
</div>
|
208
|
+
|
209
|
+
<div class="method_details ">
|
210
|
+
<p class="signature " id="hook_channel_handler-class_method">
|
211
|
+
|
212
|
+
+ (<tt>Object</tt>) <strong>hook_channel_handler</strong>(name, handler, fun)
|
213
|
+
|
214
|
+
|
215
|
+
|
216
|
+
</p><table class="source_code">
|
217
|
+
<tr>
|
218
|
+
<td>
|
219
|
+
<pre class="lines">
|
220
|
+
|
221
|
+
|
222
|
+
5
|
223
|
+
6
|
224
|
+
7</pre>
|
225
|
+
</td>
|
226
|
+
<td>
|
227
|
+
<pre class="code"><span class="info file"># File 'lib/bb/sys.rb', line 5</span>
|
228
|
+
|
229
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_hook_channel_handler identifier id'>hook_channel_handler</span> <span class='rubyid_name identifier id'>name</span><span class='comma token'>,</span> <span class='rubyid_handler identifier id'>handler</span><span class='comma token'>,</span> <span class='rubyid_fun identifier id'>fun</span>
|
230
|
+
<span class='rubyid_fun identifier id'>fun</span><span class='dot token'>.</span><span class='rubyid_call identifier id'>call</span><span class='lparen token'>(</span><span class='rubyid_Core constant id'>Core</span><span class='colon2 op'>::</span><span class='rubyid_store identifier id'>store</span><span class='lparen token'>(</span><span class='rubyid_name identifier id'>name</span><span class='comma token'>,</span> <span class='rubyid_handler identifier id'>handler</span><span class='comma token'>,</span> <span class='string val'>'channel'</span><span class='rparen token'>)</span><span class='rparen token'>)</span>
|
231
|
+
<span class='rubyid_end end kw'>end</span>
|
232
|
+
</pre>
|
233
|
+
</td>
|
234
|
+
</tr>
|
235
|
+
</table>
|
236
|
+
</div>
|
237
|
+
|
238
|
+
<div class="method_details ">
|
239
|
+
<p class="signature " id="remoteError-class_method">
|
240
|
+
|
241
|
+
+ (<tt>Object</tt>) <strong>remoteError</strong>(msg)
|
242
|
+
|
243
|
+
|
244
|
+
|
245
|
+
</p><table class="source_code">
|
246
|
+
<tr>
|
247
|
+
<td>
|
248
|
+
<pre class="lines">
|
249
|
+
|
250
|
+
|
251
|
+
9
|
252
|
+
10
|
253
|
+
11</pre>
|
254
|
+
</td>
|
255
|
+
<td>
|
256
|
+
<pre class="code"><span class="info file"># File 'lib/bb/sys.rb', line 9</span>
|
257
|
+
|
258
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_remoteError identifier id'>remoteError</span> <span class='rubyid_msg identifier id'>msg</span>
|
259
|
+
<span class='rubyid_Util constant id'>Util</span><span class='colon2 op'>::</span><span class='rubyid_err identifier id'>err</span><span class='lparen token'>(</span><span class='rubyid_msg identifier id'>msg</span><span class='rparen token'>)</span>
|
260
|
+
<span class='rubyid_end end kw'>end</span>
|
261
|
+
</pre>
|
262
|
+
</td>
|
263
|
+
</tr>
|
264
|
+
</table>
|
265
|
+
</div>
|
266
|
+
|
267
|
+
</div>
|
268
|
+
|
269
|
+
</div>
|
270
|
+
|
271
|
+
<div id="footer">
|
272
|
+
Generated on Sun Mar 4 11:14:11 2012 by
|
273
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
274
|
+
0.7.5 (ruby-1.8.7).
|
275
|
+
</div>
|
276
|
+
|
277
|
+
</body>
|
278
|
+
</html>
|
@@ -0,0 +1,746 @@
|
|
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.7.5
|
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
|
+
relpath = '..';
|
19
|
+
if (relpath != '') relpath += '/';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
23
|
+
|
24
|
+
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
25
|
+
|
26
|
+
|
27
|
+
</head>
|
28
|
+
<body>
|
29
|
+
<script type="text/javascript" charset="utf-8">
|
30
|
+
if (window.top.frames.main) document.body.className = 'frames';
|
31
|
+
</script>
|
32
|
+
|
33
|
+
<div id="header">
|
34
|
+
<div id="menu">
|
35
|
+
|
36
|
+
<a href="../_index.html">Index (U)</a> »
|
37
|
+
<span class='title'><span class='object_link'><a href="../Bridge.html" title="Bridge (module)">Bridge</a></span></span>
|
38
|
+
»
|
39
|
+
<span class="title">Util</span>
|
40
|
+
|
41
|
+
|
42
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
43
|
+
</div>
|
44
|
+
|
45
|
+
<div id="search">
|
46
|
+
|
47
|
+
<a id="class_list_link" href="#">Class List</a>
|
48
|
+
|
49
|
+
<a id="method_list_link" href="#">Method List</a>
|
50
|
+
|
51
|
+
<a id="file_list_link" href="#">File List</a>
|
52
|
+
|
53
|
+
</div>
|
54
|
+
<div class="clear"></div>
|
55
|
+
</div>
|
56
|
+
|
57
|
+
<iframe id="search_frame"></iframe>
|
58
|
+
|
59
|
+
<div id="content"><h1>Module: Bridge::Util
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
</h1>
|
64
|
+
|
65
|
+
<dl class="box">
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
<dt class="r1 last">Defined in:</dt>
|
75
|
+
<dd class="r1 last">lib/bb/util.rb</dd>
|
76
|
+
|
77
|
+
</dl>
|
78
|
+
<div class="clear"></div>
|
79
|
+
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
<h2>
|
89
|
+
Class Method Summary
|
90
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
91
|
+
</h2>
|
92
|
+
|
93
|
+
<ul class="summary">
|
94
|
+
|
95
|
+
<li class="public ">
|
96
|
+
<span class="summary_signature">
|
97
|
+
|
98
|
+
<a href="#bloat-class_method" title="bloat (class method)">+ (Object) <strong>bloat</strong>(v) </a>
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
</span>
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
112
|
+
|
113
|
+
</li>
|
114
|
+
|
115
|
+
|
116
|
+
<li class="public ">
|
117
|
+
<span class="summary_signature">
|
118
|
+
|
119
|
+
<a href="#cb-class_method" title="cb (class method)">+ (Object) <strong>cb</strong>(fun) </a>
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
</span>
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
133
|
+
|
134
|
+
</li>
|
135
|
+
|
136
|
+
|
137
|
+
<li class="public ">
|
138
|
+
<span class="summary_signature">
|
139
|
+
|
140
|
+
<a href="#deflate-class_method" title="deflate (class method)">+ (Object) <strong>deflate</strong>(obj) </a>
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
</span>
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
154
|
+
|
155
|
+
</li>
|
156
|
+
|
157
|
+
|
158
|
+
<li class="public ">
|
159
|
+
<span class="summary_signature">
|
160
|
+
|
161
|
+
<a href="#err-class_method" title="err (class method)">+ (Object) <strong>err</strong>(msg) </a>
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
</span>
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
175
|
+
|
176
|
+
</li>
|
177
|
+
|
178
|
+
|
179
|
+
<li class="public ">
|
180
|
+
<span class="summary_signature">
|
181
|
+
|
182
|
+
<a href="#has_keys%3F-class_method" title="has_keys? (class method)">+ (Boolean) <strong>has_keys?</strong>(obj, *keys) </a>
|
183
|
+
|
184
|
+
|
185
|
+
|
186
|
+
</span>
|
187
|
+
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
196
|
+
|
197
|
+
</li>
|
198
|
+
|
199
|
+
|
200
|
+
<li class="public ">
|
201
|
+
<span class="summary_signature">
|
202
|
+
|
203
|
+
<a href="#inflate-class_method" title="inflate (class method)">+ (Object) <strong>inflate</strong>(obj) </a>
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
</span>
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
|
216
|
+
<span class="summary_desc"><div class='inline'><p>
|
217
|
+
Traverses an object, replacing funs with refs.
|
218
|
+
</p>
|
219
|
+
</div></span>
|
220
|
+
|
221
|
+
</li>
|
222
|
+
|
223
|
+
|
224
|
+
<li class="public ">
|
225
|
+
<span class="summary_signature">
|
226
|
+
|
227
|
+
<a href="#local_ref-class_method" title="local_ref (class method)">+ (Object) <strong>local_ref</strong>(v) </a>
|
228
|
+
|
229
|
+
|
230
|
+
|
231
|
+
</span>
|
232
|
+
|
233
|
+
|
234
|
+
|
235
|
+
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
|
240
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
241
|
+
|
242
|
+
</li>
|
243
|
+
|
244
|
+
|
245
|
+
<li class="public ">
|
246
|
+
<span class="summary_signature">
|
247
|
+
|
248
|
+
<a href="#log-class_method" title="log (class method)">+ (Object) <strong>log</strong>(msg, level = 3) </a>
|
249
|
+
|
250
|
+
|
251
|
+
|
252
|
+
</span>
|
253
|
+
|
254
|
+
|
255
|
+
|
256
|
+
|
257
|
+
|
258
|
+
|
259
|
+
|
260
|
+
|
261
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
262
|
+
|
263
|
+
</li>
|
264
|
+
|
265
|
+
|
266
|
+
<li class="public ">
|
267
|
+
<span class="summary_signature">
|
268
|
+
|
269
|
+
<a href="#serialize-class_method" title="serialize (class method)">+ (Object) <strong>serialize</strong>(obj) </a>
|
270
|
+
|
271
|
+
|
272
|
+
|
273
|
+
</span>
|
274
|
+
|
275
|
+
|
276
|
+
|
277
|
+
|
278
|
+
|
279
|
+
|
280
|
+
|
281
|
+
|
282
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
283
|
+
|
284
|
+
</li>
|
285
|
+
|
286
|
+
|
287
|
+
<li class="public ">
|
288
|
+
<span class="summary_signature">
|
289
|
+
|
290
|
+
<a href="#unserialize-class_method" title="unserialize (class method)">+ (Object) <strong>unserialize</strong>(str) </a>
|
291
|
+
|
292
|
+
|
293
|
+
|
294
|
+
</span>
|
295
|
+
|
296
|
+
|
297
|
+
|
298
|
+
|
299
|
+
|
300
|
+
|
301
|
+
|
302
|
+
|
303
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
304
|
+
|
305
|
+
</li>
|
306
|
+
|
307
|
+
|
308
|
+
</ul>
|
309
|
+
|
310
|
+
|
311
|
+
|
312
|
+
|
313
|
+
<div id="class_method_details" class="method_details_list">
|
314
|
+
<h2>Class Method Details</h2>
|
315
|
+
|
316
|
+
|
317
|
+
<div class="method_details first">
|
318
|
+
<p class="signature first" id="bloat-class_method">
|
319
|
+
|
320
|
+
+ (<tt>Object</tt>) <strong>bloat</strong>(v)
|
321
|
+
|
322
|
+
|
323
|
+
|
324
|
+
</p><table class="source_code">
|
325
|
+
<tr>
|
326
|
+
<td>
|
327
|
+
<pre class="lines">
|
328
|
+
|
329
|
+
|
330
|
+
20
|
331
|
+
21
|
332
|
+
22
|
333
|
+
23
|
334
|
+
24
|
335
|
+
25
|
336
|
+
26
|
337
|
+
27
|
338
|
+
28
|
339
|
+
29
|
340
|
+
30</pre>
|
341
|
+
</td>
|
342
|
+
<td>
|
343
|
+
<pre class="code"><span class="info file"># File 'lib/bb/util.rb', line 20</span>
|
344
|
+
|
345
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_bloat identifier id'>bloat</span> <span class='rubyid_v identifier id'>v</span>
|
346
|
+
<span class='rubyid_if if kw'>if</span> <span class='rubyid_v identifier id'>v</span><span class='dot token'>.</span><span class='rubyid_is_a? fid id'>is_a?</span><span class='lparen token'>(</span><span class='rubyid_Module constant id'>Module</span><span class='rparen token'>)</span> <span class='orop op'>||</span> <span class='rubyid_v identifier id'>v</span><span class='dot token'>.</span><span class='rubyid_is_a? fid id'>is_a?</span><span class='lparen token'>(</span><span class='rubyid_Bridge constant id'>Bridge</span><span class='colon2 op'>::</span><span class='rubyid_Service constant id'>Service</span><span class='rparen token'>)</span>
|
347
|
+
<span class='rubyid_local_ref identifier id'>local_ref</span><span class='lparen token'>(</span><span class='rubyid_v identifier id'>v</span><span class='rparen token'>)</span>
|
348
|
+
<span class='rubyid_elsif elsif kw'>elsif</span> <span class='rubyid_v identifier id'>v</span><span class='dot token'>.</span><span class='rubyid_respond_to? fid id'>respond_to?</span><span class='lparen token'>(</span><span class='symbol val'>:call</span><span class='rparen token'>)</span> <span class='andop op'>&&</span> <span class='notop op'>!</span><span class='rubyid_v identifier id'>v</span><span class='dot token'>.</span><span class='rubyid_is_a? fid id'>is_a?</span><span class='lparen token'>(</span><span class='rubyid_Ref constant id'>Ref</span><span class='rparen token'>)</span>
|
349
|
+
<span class='rubyid_cb identifier id'>cb</span><span class='lparen token'>(</span><span class='rubyid_v identifier id'>v</span><span class='rparen token'>)</span>
|
350
|
+
<span class='rubyid_elsif elsif kw'>elsif</span> <span class='rubyid_v identifier id'>v</span><span class='dot token'>.</span><span class='rubyid_is_a? fid id'>is_a?</span><span class='lparen token'>(</span><span class='rubyid_Hash constant id'>Hash</span><span class='rparen token'>)</span> <span class='orop op'>||</span> <span class='rubyid_v identifier id'>v</span><span class='dot token'>.</span><span class='rubyid_is_a? fid id'>is_a?</span><span class='lparen token'>(</span><span class='rubyid_Array constant id'>Array</span><span class='rparen token'>)</span>
|
351
|
+
<span class='rubyid_inflate identifier id'>inflate</span> <span class='rubyid_v identifier id'>v</span>
|
352
|
+
<span class='rubyid_else else kw'>else</span>
|
353
|
+
<span class='rubyid_v identifier id'>v</span>
|
354
|
+
<span class='rubyid_end end kw'>end</span>
|
355
|
+
<span class='rubyid_end end kw'>end</span>
|
356
|
+
</pre>
|
357
|
+
</td>
|
358
|
+
</tr>
|
359
|
+
</table>
|
360
|
+
</div>
|
361
|
+
|
362
|
+
<div class="method_details ">
|
363
|
+
<p class="signature " id="cb-class_method">
|
364
|
+
|
365
|
+
+ (<tt>Object</tt>) <strong>cb</strong>(fun)
|
366
|
+
|
367
|
+
|
368
|
+
|
369
|
+
</p><table class="source_code">
|
370
|
+
<tr>
|
371
|
+
<td>
|
372
|
+
<pre class="lines">
|
373
|
+
|
374
|
+
|
375
|
+
74
|
376
|
+
75
|
377
|
+
76
|
378
|
+
77</pre>
|
379
|
+
</td>
|
380
|
+
<td>
|
381
|
+
<pre class="code"><span class="info file"># File 'lib/bb/util.rb', line 74</span>
|
382
|
+
|
383
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_cb identifier id'>cb</span> <span class='rubyid_fun identifier id'>fun</span>
|
384
|
+
<span class='rubyid_Core constant id'>Core</span><span class='colon2 op'>::</span><span class='rubyid_store identifier id'>store</span><span class='lparen token'>(</span><span class='rubyid_fun identifier id'>fun</span><span class='dot token'>.</span><span class='rubyid_object_id identifier id'>object_id</span><span class='dot token'>.</span><span class='rubyid_to_s identifier id'>to_s</span><span class='lparen token'>(</span><span class='integer val'>36</span><span class='rparen token'>)</span><span class='comma token'>,</span>
|
385
|
+
<span class='rubyid_LocalRef constant id'>LocalRef</span><span class='dot token'>.</span><span class='rubyid_new identifier id'>new</span><span class='lparen token'>(</span><span class='lbrack token'>[</span><span class='rubyid_fun identifier id'>fun</span><span class='dot token'>.</span><span class='rubyid_hash identifier id'>hash</span><span class='dot token'>.</span><span class='rubyid_to_s identifier id'>to_s</span><span class='lparen token'>(</span><span class='integer val'>36</span><span class='rparen token'>)</span><span class='rbrack token'>]</span><span class='comma token'>,</span> <span class='rubyid_Callback constant id'>Callback</span><span class='dot token'>.</span><span class='rubyid_new identifier id'>new</span><span class='lparen token'>(</span><span class='rubyid_fun identifier id'>fun</span><span class='rparen token'>)</span><span class='rparen token'>)</span><span class='rparen token'>)</span>
|
386
|
+
<span class='rubyid_end end kw'>end</span>
|
387
|
+
</pre>
|
388
|
+
</td>
|
389
|
+
</tr>
|
390
|
+
</table>
|
391
|
+
</div>
|
392
|
+
|
393
|
+
<div class="method_details ">
|
394
|
+
<p class="signature " id="deflate-class_method">
|
395
|
+
|
396
|
+
+ (<tt>Object</tt>) <strong>deflate</strong>(obj)
|
397
|
+
|
398
|
+
|
399
|
+
|
400
|
+
</p><table class="source_code">
|
401
|
+
<tr>
|
402
|
+
<td>
|
403
|
+
<pre class="lines">
|
404
|
+
|
405
|
+
|
406
|
+
32
|
407
|
+
33
|
408
|
+
34
|
409
|
+
35
|
410
|
+
36
|
411
|
+
37
|
412
|
+
38
|
413
|
+
39
|
414
|
+
40
|
415
|
+
41
|
416
|
+
42
|
417
|
+
43
|
418
|
+
44
|
419
|
+
45
|
420
|
+
46
|
421
|
+
47
|
422
|
+
48
|
423
|
+
49
|
424
|
+
50</pre>
|
425
|
+
</td>
|
426
|
+
<td>
|
427
|
+
<pre class="code"><span class="info file"># File 'lib/bb/util.rb', line 32</span>
|
428
|
+
|
429
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_deflate identifier id'>deflate</span> <span class='rubyid_obj identifier id'>obj</span>
|
430
|
+
<span class='rubyid_if if kw'>if</span> <span class='rubyid_obj identifier id'>obj</span><span class='dot token'>.</span><span class='rubyid_is_a? fid id'>is_a?</span><span class='lparen token'>(</span><span class='rubyid_Array constant id'>Array</span><span class='rparen token'>)</span>
|
431
|
+
<span class='rubyid_obj identifier id'>obj</span><span class='dot token'>.</span><span class='rubyid_map identifier id'>map</span> <span class='rubyid_do do kw'>do</span> <span class='bitor op'>|</span><span class='rubyid_v identifier id'>v</span><span class='bitor op'>|</span>
|
432
|
+
<span class='rubyid_deflate identifier id'>deflate</span> <span class='rubyid_v identifier id'>v</span>
|
433
|
+
<span class='rubyid_end end kw'>end</span>
|
434
|
+
<span class='rubyid_elsif elsif kw'>elsif</span> <span class='rubyid_obj identifier id'>obj</span><span class='dot token'>.</span><span class='rubyid_is_a? fid id'>is_a?</span> <span class='rubyid_Hash constant id'>Hash</span>
|
435
|
+
<span class='rubyid_if if kw'>if</span> <span class='rubyid_obj identifier id'>obj</span><span class='dot token'>.</span><span class='rubyid_has_key? fid id'>has_key?</span> <span class='string val'>'ref'</span>
|
436
|
+
<span class='rubyid_Core constant id'>Core</span><span class='colon2 op'>::</span><span class='rubyid_lookup identifier id'>lookup</span> <span class='rubyid_obj identifier id'>obj</span><span class='lbrack token'>[</span><span class='string val'>'ref'</span><span class='rbrack token'>]</span>
|
437
|
+
<span class='rubyid_else else kw'>else</span>
|
438
|
+
<span class='rubyid_o identifier id'>o</span> <span class='assign token'>=</span> <span class='lbrace token'>{</span><span class='rbrace token'>}</span>
|
439
|
+
<span class='rubyid_obj identifier id'>obj</span><span class='dot token'>.</span><span class='rubyid_each identifier id'>each</span> <span class='rubyid_do do kw'>do</span> <span class='bitor op'>|</span><span class='rubyid_k identifier id'>k</span><span class='comma token'>,</span> <span class='rubyid_v identifier id'>v</span><span class='bitor op'>|</span>
|
440
|
+
<span class='rubyid_o identifier id'>o</span><span class='lbrack token'>[</span><span class='rubyid_k identifier id'>k</span><span class='rbrack token'>]</span> <span class='assign token'>=</span> <span class='rubyid_deflate identifier id'>deflate</span> <span class='rubyid_v identifier id'>v</span>
|
441
|
+
<span class='rubyid_end end kw'>end</span>
|
442
|
+
<span class='rubyid_o identifier id'>o</span>
|
443
|
+
<span class='rubyid_end end kw'>end</span>
|
444
|
+
<span class='rubyid_else else kw'>else</span>
|
445
|
+
<span class='rubyid_obj identifier id'>obj</span>
|
446
|
+
<span class='rubyid_end end kw'>end</span>
|
447
|
+
<span class='rubyid_end end kw'>end</span>
|
448
|
+
</pre>
|
449
|
+
</td>
|
450
|
+
</tr>
|
451
|
+
</table>
|
452
|
+
</div>
|
453
|
+
|
454
|
+
<div class="method_details ">
|
455
|
+
<p class="signature " id="err-class_method">
|
456
|
+
|
457
|
+
+ (<tt>Object</tt>) <strong>err</strong>(msg)
|
458
|
+
|
459
|
+
|
460
|
+
|
461
|
+
</p><table class="source_code">
|
462
|
+
<tr>
|
463
|
+
<td>
|
464
|
+
<pre class="lines">
|
465
|
+
|
466
|
+
|
467
|
+
63
|
468
|
+
64
|
469
|
+
65</pre>
|
470
|
+
</td>
|
471
|
+
<td>
|
472
|
+
<pre class="code"><span class="info file"># File 'lib/bb/util.rb', line 63</span>
|
473
|
+
|
474
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_err identifier id'>err</span> <span class='rubyid_msg identifier id'>msg</span>
|
475
|
+
<span class='rubyid_$stderr gvar id'>$stderr</span><span class='dot token'>.</span><span class='rubyid_puts identifier id'>puts</span> <span class='rubyid_msg identifier id'>msg</span>
|
476
|
+
<span class='rubyid_end end kw'>end</span>
|
477
|
+
</pre>
|
478
|
+
</td>
|
479
|
+
</tr>
|
480
|
+
</table>
|
481
|
+
</div>
|
482
|
+
|
483
|
+
<div class="method_details ">
|
484
|
+
<p class="signature " id="has_keys?-class_method">
|
485
|
+
|
486
|
+
+ (<tt>Boolean</tt>) <strong>has_keys?</strong>(obj, *keys)
|
487
|
+
|
488
|
+
|
489
|
+
|
490
|
+
</p><div class="docstring">
|
491
|
+
<div class="discussion">
|
492
|
+
|
493
|
+
|
494
|
+
</div>
|
495
|
+
</div>
|
496
|
+
<div class="tags">
|
497
|
+
|
498
|
+
<h3>Returns:</h3>
|
499
|
+
<ul class="return">
|
500
|
+
|
501
|
+
<li>
|
502
|
+
|
503
|
+
|
504
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
505
|
+
|
506
|
+
|
507
|
+
|
508
|
+
</li>
|
509
|
+
|
510
|
+
</ul>
|
511
|
+
|
512
|
+
</div><table class="source_code">
|
513
|
+
<tr>
|
514
|
+
<td>
|
515
|
+
<pre class="lines">
|
516
|
+
|
517
|
+
|
518
|
+
79
|
519
|
+
80
|
520
|
+
81
|
521
|
+
82
|
522
|
+
83
|
523
|
+
84
|
524
|
+
85
|
525
|
+
86</pre>
|
526
|
+
</td>
|
527
|
+
<td>
|
528
|
+
<pre class="code"><span class="info file"># File 'lib/bb/util.rb', line 79</span>
|
529
|
+
|
530
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_has_keys? fid id'>has_keys?</span> <span class='rubyid_obj identifier id'>obj</span><span class='comma token'>,</span> <span class='mult op'>*</span><span class='rubyid_keys identifier id'>keys</span>
|
531
|
+
<span class='rubyid_keys identifier id'>keys</span><span class='dot token'>.</span><span class='rubyid_each identifier id'>each</span> <span class='rubyid_do do kw'>do</span> <span class='bitor op'>|</span><span class='rubyid_k identifier id'>k</span><span class='bitor op'>|</span>
|
532
|
+
<span class='rubyid_if if kw'>if</span> <span class='notop op'>!</span><span class='rubyid_obj identifier id'>obj</span><span class='dot token'>.</span><span class='rubyid_has_key? fid id'>has_key?</span><span class='lparen token'>(</span><span class='rubyid_k identifier id'>k</span><span class='rparen token'>)</span> <span class='andop op'>&&</span> <span class='notop op'>!</span><span class='rubyid_obj identifier id'>obj</span><span class='dot token'>.</span><span class='rubyid_has_key? fid id'>has_key?</span><span class='lparen token'>(</span><span class='rubyid_k identifier id'>k</span><span class='dot token'>.</span><span class='rubyid_to_sym identifier id'>to_sym</span><span class='rparen token'>)</span>
|
533
|
+
<span class='rubyid_return return kw'>return</span> <span class='rubyid_false false kw'>false</span>
|
534
|
+
<span class='rubyid_end end kw'>end</span>
|
535
|
+
<span class='rubyid_end end kw'>end</span>
|
536
|
+
<span class='rubyid_true true kw'>true</span>
|
537
|
+
<span class='rubyid_end end kw'>end</span>
|
538
|
+
</pre>
|
539
|
+
</td>
|
540
|
+
</tr>
|
541
|
+
</table>
|
542
|
+
</div>
|
543
|
+
|
544
|
+
<div class="method_details ">
|
545
|
+
<p class="signature " id="inflate-class_method">
|
546
|
+
|
547
|
+
+ (<tt>Object</tt>) <strong>inflate</strong>(obj)
|
548
|
+
|
549
|
+
|
550
|
+
|
551
|
+
</p><div class="docstring">
|
552
|
+
<div class="discussion">
|
553
|
+
<p>
|
554
|
+
Traverses an object, replacing funs with refs.
|
555
|
+
</p>
|
556
|
+
|
557
|
+
|
558
|
+
</div>
|
559
|
+
</div>
|
560
|
+
<div class="tags">
|
561
|
+
|
562
|
+
|
563
|
+
</div><table class="source_code">
|
564
|
+
<tr>
|
565
|
+
<td>
|
566
|
+
<pre class="lines">
|
567
|
+
|
568
|
+
|
569
|
+
6
|
570
|
+
7
|
571
|
+
8
|
572
|
+
9
|
573
|
+
10
|
574
|
+
11
|
575
|
+
12
|
576
|
+
13
|
577
|
+
14
|
578
|
+
15
|
579
|
+
16
|
580
|
+
17
|
581
|
+
18</pre>
|
582
|
+
</td>
|
583
|
+
<td>
|
584
|
+
<pre class="code"><span class="info file"># File 'lib/bb/util.rb', line 6</span>
|
585
|
+
|
586
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_inflate identifier id'>inflate</span> <span class='rubyid_obj identifier id'>obj</span>
|
587
|
+
<span class='rubyid_if if kw'>if</span> <span class='rubyid_obj identifier id'>obj</span><span class='dot token'>.</span><span class='rubyid_is_a? fid id'>is_a?</span><span class='lparen token'>(</span><span class='rubyid_Array constant id'>Array</span><span class='rparen token'>)</span>
|
588
|
+
<span class='rubyid_obj identifier id'>obj</span><span class='dot token'>.</span><span class='rubyid_map identifier id'>map</span> <span class='rubyid_do do kw'>do</span> <span class='bitor op'>|</span><span class='rubyid_v identifier id'>v</span><span class='bitor op'>|</span>
|
589
|
+
<span class='rubyid_Util constant id'>Util</span><span class='colon2 op'>::</span><span class='rubyid_bloat identifier id'>bloat</span> <span class='rubyid_v identifier id'>v</span>
|
590
|
+
<span class='rubyid_end end kw'>end</span>
|
591
|
+
<span class='rubyid_else else kw'>else</span>
|
592
|
+
<span class='rubyid_o identifier id'>o</span> <span class='assign token'>=</span> <span class='lbrace token'>{</span><span class='rbrace token'>}</span>
|
593
|
+
<span class='rubyid_obj identifier id'>obj</span><span class='dot token'>.</span><span class='rubyid_each identifier id'>each</span> <span class='rubyid_do do kw'>do</span> <span class='bitor op'>|</span><span class='rubyid_k identifier id'>k</span><span class='comma token'>,</span> <span class='rubyid_v identifier id'>v</span><span class='bitor op'>|</span>
|
594
|
+
<span class='rubyid_o identifier id'>o</span><span class='lbrack token'>[</span><span class='rubyid_k identifier id'>k</span><span class='rbrack token'>]</span> <span class='assign token'>=</span> <span class='rubyid_Util constant id'>Util</span><span class='colon2 op'>::</span><span class='rubyid_bloat identifier id'>bloat</span> <span class='rubyid_v identifier id'>v</span>
|
595
|
+
<span class='rubyid_end end kw'>end</span>
|
596
|
+
<span class='rubyid_o identifier id'>o</span>
|
597
|
+
<span class='rubyid_end end kw'>end</span>
|
598
|
+
<span class='rubyid_end end kw'>end</span>
|
599
|
+
</pre>
|
600
|
+
</td>
|
601
|
+
</tr>
|
602
|
+
</table>
|
603
|
+
</div>
|
604
|
+
|
605
|
+
<div class="method_details ">
|
606
|
+
<p class="signature " id="local_ref-class_method">
|
607
|
+
|
608
|
+
+ (<tt>Object</tt>) <strong>local_ref</strong>(v)
|
609
|
+
|
610
|
+
|
611
|
+
|
612
|
+
</p><table class="source_code">
|
613
|
+
<tr>
|
614
|
+
<td>
|
615
|
+
<pre class="lines">
|
616
|
+
|
617
|
+
|
618
|
+
88
|
619
|
+
89
|
620
|
+
90
|
621
|
+
91</pre>
|
622
|
+
</td>
|
623
|
+
<td>
|
624
|
+
<pre class="code"><span class="info file"># File 'lib/bb/util.rb', line 88</span>
|
625
|
+
|
626
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_local_ref identifier id'>local_ref</span> <span class='rubyid_v identifier id'>v</span>
|
627
|
+
<span class='rubyid_key identifier id'>key</span> <span class='assign token'>=</span> <span class='rubyid_v identifier id'>v</span><span class='dot token'>.</span><span class='rubyid_object_id identifier id'>object_id</span><span class='dot token'>.</span><span class='rubyid_to_s identifier id'>to_s</span><span class='lparen token'>(</span><span class='integer val'>36</span><span class='rparen token'>)</span>
|
628
|
+
<span class='rubyid_Core constant id'>Core</span><span class='colon2 op'>::</span><span class='rubyid_store identifier id'>store</span> <span class='rubyid_key identifier id'>key</span><span class='comma token'>,</span> <span class='rubyid_Bridge constant id'>Bridge</span><span class='colon2 op'>::</span><span class='rubyid_LocalRef constant id'>LocalRef</span><span class='dot token'>.</span><span class='rubyid_new identifier id'>new</span><span class='lparen token'>(</span><span class='lbrack token'>[</span><span class='rubyid_key identifier id'>key</span><span class='rbrack token'>]</span><span class='comma token'>,</span> <span class='rubyid_v identifier id'>v</span><span class='rparen token'>)</span>
|
629
|
+
<span class='rubyid_end end kw'>end</span>
|
630
|
+
</pre>
|
631
|
+
</td>
|
632
|
+
</tr>
|
633
|
+
</table>
|
634
|
+
</div>
|
635
|
+
|
636
|
+
<div class="method_details ">
|
637
|
+
<p class="signature " id="log-class_method">
|
638
|
+
|
639
|
+
+ (<tt>Object</tt>) <strong>log</strong>(msg, level = 3)
|
640
|
+
|
641
|
+
|
642
|
+
|
643
|
+
</p><table class="source_code">
|
644
|
+
<tr>
|
645
|
+
<td>
|
646
|
+
<pre class="lines">
|
647
|
+
|
648
|
+
|
649
|
+
67
|
650
|
+
68
|
651
|
+
69
|
652
|
+
70
|
653
|
+
71
|
654
|
+
72</pre>
|
655
|
+
</td>
|
656
|
+
<td>
|
657
|
+
<pre class="code"><span class="info file"># File 'lib/bb/util.rb', line 67</span>
|
658
|
+
|
659
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_log identifier id'>log</span> <span class='rubyid_msg identifier id'>msg</span><span class='comma token'>,</span> <span class='rubyid_level identifier id'>level</span> <span class='assign token'>=</span> <span class='integer val'>3</span>
|
660
|
+
<span class='rubyid_opts identifier id'>opts</span> <span class='assign token'>=</span> <span class='rubyid_Bridge constant id'>Bridge</span><span class='colon2 op'>::</span><span class='rubyid_options identifier id'>options</span>
|
661
|
+
<span class='rubyid_if if kw'>if</span> <span class='rubyid_level identifier id'>level</span> <span class='leq op'><=</span> <span class='rubyid_opts identifier id'>opts</span><span class='lbrack token'>[</span><span class='string val'>'log_level'</span><span class='rbrack token'>]</span>
|
662
|
+
<span class='rubyid_puts identifier id'>puts</span> <span class='rubyid_msg identifier id'>msg</span>
|
663
|
+
<span class='rubyid_end end kw'>end</span>
|
664
|
+
<span class='rubyid_end end kw'>end</span>
|
665
|
+
</pre>
|
666
|
+
</td>
|
667
|
+
</tr>
|
668
|
+
</table>
|
669
|
+
</div>
|
670
|
+
|
671
|
+
<div class="method_details ">
|
672
|
+
<p class="signature " id="serialize-class_method">
|
673
|
+
|
674
|
+
+ (<tt>Object</tt>) <strong>serialize</strong>(obj)
|
675
|
+
|
676
|
+
|
677
|
+
|
678
|
+
</p><table class="source_code">
|
679
|
+
<tr>
|
680
|
+
<td>
|
681
|
+
<pre class="lines">
|
682
|
+
|
683
|
+
|
684
|
+
52
|
685
|
+
53
|
686
|
+
54
|
687
|
+
55
|
688
|
+
56</pre>
|
689
|
+
</td>
|
690
|
+
<td>
|
691
|
+
<pre class="code"><span class="info file"># File 'lib/bb/util.rb', line 52</span>
|
692
|
+
|
693
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_serialize identifier id'>serialize</span> <span class='rubyid_obj identifier id'>obj</span>
|
694
|
+
<span class='rubyid_obj identifier id'>obj</span> <span class='assign token'>=</span> <span class='rubyid_inflate identifier id'>inflate</span><span class='lparen token'>(</span><span class='rubyid_obj identifier id'>obj</span><span class='rparen token'>)</span>
|
695
|
+
<span class='rubyid_str identifier id'>str</span> <span class='assign token'>=</span> <span class='rubyid_JSON constant id'>JSON</span><span class='colon2 op'>::</span><span class='rubyid_generate identifier id'>generate</span> <span class='rubyid_obj identifier id'>obj</span>
|
696
|
+
<span class='lbrack token'>[</span><span class='rubyid_str identifier id'>str</span><span class='dot token'>.</span><span class='rubyid_length identifier id'>length</span><span class='rbrack token'>]</span><span class='dot token'>.</span><span class='rubyid_pack identifier id'>pack</span><span class='lparen token'>(</span><span class='string val'>"N"</span><span class='rparen token'>)</span> <span class='plus op'>+</span> <span class='rubyid_str identifier id'>str</span>
|
697
|
+
<span class='rubyid_end end kw'>end</span>
|
698
|
+
</pre>
|
699
|
+
</td>
|
700
|
+
</tr>
|
701
|
+
</table>
|
702
|
+
</div>
|
703
|
+
|
704
|
+
<div class="method_details ">
|
705
|
+
<p class="signature " id="unserialize-class_method">
|
706
|
+
|
707
|
+
+ (<tt>Object</tt>) <strong>unserialize</strong>(str)
|
708
|
+
|
709
|
+
|
710
|
+
|
711
|
+
</p><table class="source_code">
|
712
|
+
<tr>
|
713
|
+
<td>
|
714
|
+
<pre class="lines">
|
715
|
+
|
716
|
+
|
717
|
+
58
|
718
|
+
59
|
719
|
+
60
|
720
|
+
61</pre>
|
721
|
+
</td>
|
722
|
+
<td>
|
723
|
+
<pre class="code"><span class="info file"># File 'lib/bb/util.rb', line 58</span>
|
724
|
+
|
725
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_unserialize identifier id'>unserialize</span> <span class='rubyid_str identifier id'>str</span>
|
726
|
+
<span class='rubyid_obj identifier id'>obj</span> <span class='assign token'>=</span> <span class='rubyid_deflate identifier id'>deflate</span><span class='lparen token'>(</span><span class='rubyid_JSON constant id'>JSON</span><span class='colon2 op'>::</span><span class='rubyid_parse identifier id'>parse</span> <span class='rubyid_str identifier id'>str</span><span class='rparen token'>)</span>
|
727
|
+
<span class='rubyid_deflate identifier id'>deflate</span> <span class='rubyid_obj identifier id'>obj</span>
|
728
|
+
<span class='rubyid_end end kw'>end</span>
|
729
|
+
</pre>
|
730
|
+
</td>
|
731
|
+
</tr>
|
732
|
+
</table>
|
733
|
+
</div>
|
734
|
+
|
735
|
+
</div>
|
736
|
+
|
737
|
+
</div>
|
738
|
+
|
739
|
+
<div id="footer">
|
740
|
+
Generated on Sun Mar 4 11:14:11 2012 by
|
741
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
742
|
+
0.7.5 (ruby-1.8.7).
|
743
|
+
</div>
|
744
|
+
|
745
|
+
</body>
|
746
|
+
</html>
|