hyper-resource 1.0.0.lap79 → 1.0.0.lap80
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.
- checksums.yaml +4 -4
- data/.gitignore +3 -0
- data/.yardopts +1 -0
- data/API.md +62 -0
- data/Gemfile +2 -0
- data/JSON_format.md +62 -0
- data/PubSub.md +20 -0
- data/README.md +2 -0
- data/Security.md +0 -0
- data/docs/HyperRecord/ClassMethods.html +2969 -0
- data/docs/HyperRecord/ClientInstanceMethods.html +1833 -0
- data/docs/HyperRecord/Collection.html +564 -0
- data/docs/HyperRecord/DummyValue.html +384 -0
- data/docs/HyperRecord/PubSub/ClassMethods.html +2047 -0
- data/docs/HyperRecord/PubSub.html +1679 -0
- data/docs/HyperRecord/ServerClassMethods.html +697 -0
- data/docs/HyperRecord.html +119 -0
- data/docs/Hyperloop/Resource/ClientDrivers.html +352 -0
- data/docs/Hyperloop/Resource/HTTP.html +1795 -0
- data/docs/Hyperloop/Resource/MethodsController.html +479 -0
- data/docs/Hyperloop/Resource/PropertiesController.html +225 -0
- data/docs/Hyperloop/Resource/PubSub/ClassMethods.html +105 -0
- data/docs/Hyperloop/Resource/PubSub.html +1210 -0
- data/docs/Hyperloop/Resource/RelationsController.html +529 -0
- data/docs/Hyperloop/Resource/ScopesController.html +380 -0
- data/docs/Hyperloop/Resource/SecurityError.html +124 -0
- data/docs/Hyperloop/Resource/SecurityGuards/ClassMethods.html +226 -0
- data/docs/Hyperloop/Resource/SecurityGuards.html +299 -0
- data/docs/Hyperloop/Resource.html +135 -0
- data/docs/Hyperloop.html +186 -0
- data/docs/_index.html +302 -0
- data/docs/class_list.html +51 -0
- data/docs/css/common.css +1 -0
- data/docs/css/full_list.css +58 -0
- data/docs/css/style.css +496 -0
- data/docs/file.API.html +138 -0
- data/docs/file.JSON_format.html +134 -0
- data/docs/file.PubSub.html +86 -0
- data/docs/file.README.html +192 -0
- data/docs/file_list.html +71 -0
- data/docs/frames.html +17 -0
- data/docs/index.html +192 -0
- data/docs/js/app.js +292 -0
- data/docs/js/full_list.js +216 -0
- data/docs/js/jquery.js +4 -0
- data/docs/method_list.html +1115 -0
- data/docs/top-level-namespace.html +110 -0
- data/hyper-resource.gemspec +19 -18
- data/lib/hyper_record/class_methods.rb +186 -3
- data/lib/hyper_record/client_instance_methods.rb +68 -3
- data/lib/hyper_record/collection.rb +19 -4
- data/lib/hyper_record/pub_sub.rb +92 -12
- data/lib/hyper_record/server_class_methods.rb +15 -0
- data/lib/hyperloop/resource/client_drivers.rb +2 -0
- data/lib/hyperloop/resource/http.rb +33 -22
- data/lib/hyperloop/resource/pub_sub.rb +2 -0
- data/lib/hyperloop/resource/version.rb +1 -1
- metadata +61 -2
@@ -0,0 +1,1679 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
+
<title>
|
7
|
+
Module: HyperRecord::PubSub
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.13
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
pathId = "HyperRecord::PubSub";
|
19
|
+
relpath = '../';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
|
23
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
24
|
+
|
25
|
+
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
26
|
+
|
27
|
+
|
28
|
+
</head>
|
29
|
+
<body>
|
30
|
+
<div class="nav_wrap">
|
31
|
+
<iframe id="nav" src="../class_list.html?1"></iframe>
|
32
|
+
<div id="resizer"></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="main" tabindex="-1">
|
36
|
+
<div id="header">
|
37
|
+
<div id="menu">
|
38
|
+
|
39
|
+
<a href="../_index.html">Index (P)</a> »
|
40
|
+
<span class='title'><span class='object_link'><a href="../HyperRecord.html" title="HyperRecord (module)">HyperRecord</a></span></span>
|
41
|
+
»
|
42
|
+
<span class="title">PubSub</span>
|
43
|
+
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<div id="search">
|
47
|
+
|
48
|
+
<a class="full_list_link" id="class_list_link"
|
49
|
+
href="../class_list.html">
|
50
|
+
|
51
|
+
<svg width="24" height="24">
|
52
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
+
</svg>
|
56
|
+
</a>
|
57
|
+
|
58
|
+
</div>
|
59
|
+
<div class="clear"></div>
|
60
|
+
</div>
|
61
|
+
|
62
|
+
<div id="content"><h1>Module: HyperRecord::PubSub
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
<dl>
|
80
|
+
<dt>Defined in:</dt>
|
81
|
+
<dd>lib/hyper_record/pub_sub.rb</dd>
|
82
|
+
</dl>
|
83
|
+
|
84
|
+
</div>
|
85
|
+
|
86
|
+
<h2>Defined Under Namespace</h2>
|
87
|
+
<p class="children">
|
88
|
+
|
89
|
+
|
90
|
+
<strong class="modules">Modules:</strong> <span class='object_link'><a href="PubSub/ClassMethods.html" title="HyperRecord::PubSub::ClassMethods (module)">ClassMethods</a></span>
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
</p>
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
<h2>
|
105
|
+
Instance Method Summary
|
106
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
107
|
+
</h2>
|
108
|
+
|
109
|
+
<ul class="summary">
|
110
|
+
|
111
|
+
<li class="public ">
|
112
|
+
<span class="summary_signature">
|
113
|
+
|
114
|
+
<a href="#pub_sub_record-instance_method" title="#pub_sub_record (instance method)">#<strong>pub_sub_record</strong>(record) ⇒ Object </a>
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
</span>
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
<span class="summary_desc"><div class='inline'>
|
129
|
+
<p>subscribe to record and then publish.</p>
|
130
|
+
</div></span>
|
131
|
+
|
132
|
+
</li>
|
133
|
+
|
134
|
+
|
135
|
+
<li class="public ">
|
136
|
+
<span class="summary_signature">
|
137
|
+
|
138
|
+
<a href="#pub_sub_relation-instance_method" title="#pub_sub_relation (instance method)">#<strong>pub_sub_relation</strong>(relation, base_record, relation_name, causing_record = nil) ⇒ Object </a>
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
</span>
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
<span class="summary_desc"><div class='inline'>
|
153
|
+
<p>subscribe to relation changes and then publish them.</p>
|
154
|
+
</div></span>
|
155
|
+
|
156
|
+
</li>
|
157
|
+
|
158
|
+
|
159
|
+
<li class="public ">
|
160
|
+
<span class="summary_signature">
|
161
|
+
|
162
|
+
<a href="#pub_sub_rest_class_method-instance_method" title="#pub_sub_rest_class_method (instance method)">#<strong>pub_sub_rest_class_method</strong>(record_class, rest_class_method_name) ⇒ Object </a>
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
</span>
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
<span class="summary_desc"><div class='inline'>
|
177
|
+
<p>subscribe to rest_class_method and then send message to notify clients that
|
178
|
+
they should call the rest_class_method again.</p>
|
179
|
+
</div></span>
|
180
|
+
|
181
|
+
</li>
|
182
|
+
|
183
|
+
|
184
|
+
<li class="public ">
|
185
|
+
<span class="summary_signature">
|
186
|
+
|
187
|
+
<a href="#pub_sub_rest_method-instance_method" title="#pub_sub_rest_method (instance method)">#<strong>pub_sub_rest_method</strong>(record, rest_method_name) ⇒ Object </a>
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
</span>
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
<span class="summary_desc"><div class='inline'>
|
202
|
+
<p>subscribe to rest_method and then send message to notify clients that they
|
203
|
+
should call the rest_method again.</p>
|
204
|
+
</div></span>
|
205
|
+
|
206
|
+
</li>
|
207
|
+
|
208
|
+
|
209
|
+
<li class="public ">
|
210
|
+
<span class="summary_signature">
|
211
|
+
|
212
|
+
<a href="#pub_sub_scope-instance_method" title="#pub_sub_scope (instance method)">#<strong>pub_sub_scope</strong>(collection, record_class, scope_name) ⇒ Object </a>
|
213
|
+
|
214
|
+
|
215
|
+
|
216
|
+
</span>
|
217
|
+
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
|
226
|
+
<span class="summary_desc"><div class='inline'>
|
227
|
+
<p>subscribe to scope changes and send message about scope change to all
|
228
|
+
subscribers.</p>
|
229
|
+
</div></span>
|
230
|
+
|
231
|
+
</li>
|
232
|
+
|
233
|
+
|
234
|
+
<li class="public ">
|
235
|
+
<span class="summary_signature">
|
236
|
+
|
237
|
+
<a href="#publish_record-instance_method" title="#publish_record (instance method)">#<strong>publish_record</strong>(record) ⇒ Object </a>
|
238
|
+
|
239
|
+
|
240
|
+
|
241
|
+
</span>
|
242
|
+
|
243
|
+
|
244
|
+
|
245
|
+
|
246
|
+
|
247
|
+
|
248
|
+
|
249
|
+
|
250
|
+
|
251
|
+
<span class="summary_desc"><div class='inline'>
|
252
|
+
<p>send message about record change to all subscribers of this record.</p>
|
253
|
+
</div></span>
|
254
|
+
|
255
|
+
</li>
|
256
|
+
|
257
|
+
|
258
|
+
<li class="public ">
|
259
|
+
<span class="summary_signature">
|
260
|
+
|
261
|
+
<a href="#publish_relation-instance_method" title="#publish_relation (instance method)">#<strong>publish_relation</strong>(base_record, relation_name, record = nil) ⇒ Object </a>
|
262
|
+
|
263
|
+
|
264
|
+
|
265
|
+
</span>
|
266
|
+
|
267
|
+
|
268
|
+
|
269
|
+
|
270
|
+
|
271
|
+
|
272
|
+
|
273
|
+
|
274
|
+
|
275
|
+
<span class="summary_desc"><div class='inline'>
|
276
|
+
<p>send message about relation change to all subscribers of this record.</p>
|
277
|
+
</div></span>
|
278
|
+
|
279
|
+
</li>
|
280
|
+
|
281
|
+
|
282
|
+
<li class="public ">
|
283
|
+
<span class="summary_signature">
|
284
|
+
|
285
|
+
<a href="#publish_rest_class_method-instance_method" title="#publish_rest_class_method (instance method)">#<strong>publish_rest_class_method</strong>(record_class, rest_class_method_name) ⇒ Object </a>
|
286
|
+
|
287
|
+
|
288
|
+
|
289
|
+
</span>
|
290
|
+
|
291
|
+
|
292
|
+
|
293
|
+
|
294
|
+
|
295
|
+
|
296
|
+
|
297
|
+
|
298
|
+
|
299
|
+
<span class="summary_desc"><div class='inline'>
|
300
|
+
<p>send message to notify clients that they should call the rest_class_method
|
301
|
+
again.</p>
|
302
|
+
</div></span>
|
303
|
+
|
304
|
+
</li>
|
305
|
+
|
306
|
+
|
307
|
+
<li class="public ">
|
308
|
+
<span class="summary_signature">
|
309
|
+
|
310
|
+
<a href="#publish_rest_method-instance_method" title="#publish_rest_method (instance method)">#<strong>publish_rest_method</strong>(record, rest_method_name) ⇒ Object </a>
|
311
|
+
|
312
|
+
|
313
|
+
|
314
|
+
</span>
|
315
|
+
|
316
|
+
|
317
|
+
|
318
|
+
|
319
|
+
|
320
|
+
|
321
|
+
|
322
|
+
|
323
|
+
|
324
|
+
<span class="summary_desc"><div class='inline'>
|
325
|
+
<p>send message to notify clients that they should call the rest_method again.</p>
|
326
|
+
</div></span>
|
327
|
+
|
328
|
+
</li>
|
329
|
+
|
330
|
+
|
331
|
+
<li class="public ">
|
332
|
+
<span class="summary_signature">
|
333
|
+
|
334
|
+
<a href="#publish_scope-instance_method" title="#publish_scope (instance method)">#<strong>publish_scope</strong>(record_class, scope_name) ⇒ Object </a>
|
335
|
+
|
336
|
+
|
337
|
+
|
338
|
+
</span>
|
339
|
+
|
340
|
+
|
341
|
+
|
342
|
+
|
343
|
+
|
344
|
+
|
345
|
+
|
346
|
+
|
347
|
+
|
348
|
+
<span class="summary_desc"><div class='inline'>
|
349
|
+
<p>send message about scope change to all subscribers.</p>
|
350
|
+
</div></span>
|
351
|
+
|
352
|
+
</li>
|
353
|
+
|
354
|
+
|
355
|
+
<li class="public ">
|
356
|
+
<span class="summary_signature">
|
357
|
+
|
358
|
+
<a href="#subscribe_record-instance_method" title="#subscribe_record (instance method)">#<strong>subscribe_record</strong>(record) ⇒ Object </a>
|
359
|
+
|
360
|
+
|
361
|
+
|
362
|
+
</span>
|
363
|
+
|
364
|
+
|
365
|
+
|
366
|
+
|
367
|
+
|
368
|
+
|
369
|
+
|
370
|
+
|
371
|
+
|
372
|
+
<span class="summary_desc"><div class='inline'>
|
373
|
+
<p>subscribe to record changes.</p>
|
374
|
+
</div></span>
|
375
|
+
|
376
|
+
</li>
|
377
|
+
|
378
|
+
|
379
|
+
<li class="public ">
|
380
|
+
<span class="summary_signature">
|
381
|
+
|
382
|
+
<a href="#subscribe_relation-instance_method" title="#subscribe_relation (instance method)">#<strong>subscribe_relation</strong>(relation, base_record = nil, relation_name = nil) ⇒ Object </a>
|
383
|
+
|
384
|
+
|
385
|
+
|
386
|
+
</span>
|
387
|
+
|
388
|
+
|
389
|
+
|
390
|
+
|
391
|
+
|
392
|
+
|
393
|
+
|
394
|
+
|
395
|
+
|
396
|
+
<span class="summary_desc"><div class='inline'>
|
397
|
+
<p>subscribe to relation changes.</p>
|
398
|
+
</div></span>
|
399
|
+
|
400
|
+
</li>
|
401
|
+
|
402
|
+
|
403
|
+
<li class="public ">
|
404
|
+
<span class="summary_signature">
|
405
|
+
|
406
|
+
<a href="#subscribe_rest_class_method-instance_method" title="#subscribe_rest_class_method (instance method)">#<strong>subscribe_rest_class_method</strong>(record_class, rest_class_method_name) ⇒ Object </a>
|
407
|
+
|
408
|
+
|
409
|
+
|
410
|
+
</span>
|
411
|
+
|
412
|
+
|
413
|
+
|
414
|
+
|
415
|
+
|
416
|
+
|
417
|
+
|
418
|
+
|
419
|
+
|
420
|
+
<span class="summary_desc"><div class='inline'>
|
421
|
+
<p>subscribe to rest_class_method updates.</p>
|
422
|
+
</div></span>
|
423
|
+
|
424
|
+
</li>
|
425
|
+
|
426
|
+
|
427
|
+
<li class="public ">
|
428
|
+
<span class="summary_signature">
|
429
|
+
|
430
|
+
<a href="#subscribe_rest_method-instance_method" title="#subscribe_rest_method (instance method)">#<strong>subscribe_rest_method</strong>(record, rest_method_name) ⇒ Object </a>
|
431
|
+
|
432
|
+
|
433
|
+
|
434
|
+
</span>
|
435
|
+
|
436
|
+
|
437
|
+
|
438
|
+
|
439
|
+
|
440
|
+
|
441
|
+
|
442
|
+
|
443
|
+
|
444
|
+
<span class="summary_desc"><div class='inline'>
|
445
|
+
<p>subscribe to rest_method updates.</p>
|
446
|
+
</div></span>
|
447
|
+
|
448
|
+
</li>
|
449
|
+
|
450
|
+
|
451
|
+
<li class="public ">
|
452
|
+
<span class="summary_signature">
|
453
|
+
|
454
|
+
<a href="#subscribe_scope-instance_method" title="#subscribe_scope (instance method)">#<strong>subscribe_scope</strong>(collection, record_class = nil, scope_name = nil) ⇒ Object </a>
|
455
|
+
|
456
|
+
|
457
|
+
|
458
|
+
</span>
|
459
|
+
|
460
|
+
|
461
|
+
|
462
|
+
|
463
|
+
|
464
|
+
|
465
|
+
|
466
|
+
|
467
|
+
|
468
|
+
<span class="summary_desc"><div class='inline'>
|
469
|
+
<p>subscribe to scope updates.</p>
|
470
|
+
</div></span>
|
471
|
+
|
472
|
+
</li>
|
473
|
+
|
474
|
+
|
475
|
+
</ul>
|
476
|
+
|
477
|
+
|
478
|
+
|
479
|
+
|
480
|
+
<div id="instance_method_details" class="method_details_list">
|
481
|
+
<h2>Instance Method Details</h2>
|
482
|
+
|
483
|
+
|
484
|
+
<div class="method_details first">
|
485
|
+
<h3 class="signature first" id="pub_sub_record-instance_method">
|
486
|
+
|
487
|
+
#<strong>pub_sub_record</strong>(record) ⇒ <tt>Object</tt>
|
488
|
+
|
489
|
+
|
490
|
+
|
491
|
+
|
492
|
+
|
493
|
+
</h3><div class="docstring">
|
494
|
+
<div class="discussion">
|
495
|
+
|
496
|
+
<p>subscribe to record and then publish</p>
|
497
|
+
|
498
|
+
|
499
|
+
</div>
|
500
|
+
</div>
|
501
|
+
<div class="tags">
|
502
|
+
<p class="tag_title">Parameters:</p>
|
503
|
+
<ul class="param">
|
504
|
+
|
505
|
+
<li>
|
506
|
+
|
507
|
+
<span class='name'>record</span>
|
508
|
+
|
509
|
+
|
510
|
+
<span class='type'></span>
|
511
|
+
|
512
|
+
|
513
|
+
|
514
|
+
—
|
515
|
+
<div class='inline'>
|
516
|
+
<p>of ORM psecific type</p>
|
517
|
+
</div>
|
518
|
+
|
519
|
+
</li>
|
520
|
+
|
521
|
+
</ul>
|
522
|
+
|
523
|
+
|
524
|
+
</div><table class="source_code">
|
525
|
+
<tr>
|
526
|
+
<td>
|
527
|
+
<pre class="lines">
|
528
|
+
|
529
|
+
|
530
|
+
353
|
531
|
+
354
|
532
|
+
355</pre>
|
533
|
+
</td>
|
534
|
+
<td>
|
535
|
+
<pre class="code"><span class="info file"># File 'lib/hyper_record/pub_sub.rb', line 353</span>
|
536
|
+
|
537
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_pub_sub_record'>pub_sub_record</span><span class='lparen'>(</span><span class='id identifier rubyid_record'>record</span><span class='rparen'>)</span>
|
538
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_pub_sub_record'>pub_sub_record</span><span class='lparen'>(</span><span class='id identifier rubyid_record'>record</span><span class='rparen'>)</span>
|
539
|
+
<span class='kw'>end</span></pre>
|
540
|
+
</td>
|
541
|
+
</tr>
|
542
|
+
</table>
|
543
|
+
</div>
|
544
|
+
|
545
|
+
<div class="method_details ">
|
546
|
+
<h3 class="signature " id="pub_sub_relation-instance_method">
|
547
|
+
|
548
|
+
#<strong>pub_sub_relation</strong>(relation, base_record, relation_name, causing_record = nil) ⇒ <tt>Object</tt>
|
549
|
+
|
550
|
+
|
551
|
+
|
552
|
+
|
553
|
+
|
554
|
+
</h3><div class="docstring">
|
555
|
+
<div class="discussion">
|
556
|
+
|
557
|
+
<p>subscribe to relation changes and then publish them</p>
|
558
|
+
|
559
|
+
|
560
|
+
</div>
|
561
|
+
</div>
|
562
|
+
<div class="tags">
|
563
|
+
<p class="tag_title">Parameters:</p>
|
564
|
+
<ul class="param">
|
565
|
+
|
566
|
+
<li>
|
567
|
+
|
568
|
+
<span class='name'>relation</span>
|
569
|
+
|
570
|
+
|
571
|
+
<span class='type'>(<tt>Enumarable</tt>)</span>
|
572
|
+
|
573
|
+
|
574
|
+
|
575
|
+
—
|
576
|
+
<div class='inline'>
|
577
|
+
<p>or record of ORM specific type, subscribe to each member of relation</p>
|
578
|
+
</div>
|
579
|
+
|
580
|
+
</li>
|
581
|
+
|
582
|
+
<li>
|
583
|
+
|
584
|
+
<span class='name'>base_record</span>
|
585
|
+
|
586
|
+
|
587
|
+
<span class='type'></span>
|
588
|
+
|
589
|
+
|
590
|
+
|
591
|
+
—
|
592
|
+
<div class='inline'>
|
593
|
+
<p>of ORM specific type, base_record must respond to: id, updated_at,
|
594
|
+
destroyed?</p>
|
595
|
+
</div>
|
596
|
+
|
597
|
+
</li>
|
598
|
+
|
599
|
+
<li>
|
600
|
+
|
601
|
+
<span class='name'>relation_name</span>
|
602
|
+
|
603
|
+
|
604
|
+
<span class='type'>(<tt>String</tt>)</span>
|
605
|
+
|
606
|
+
|
607
|
+
|
608
|
+
</li>
|
609
|
+
|
610
|
+
<li>
|
611
|
+
|
612
|
+
<span class='name'>causing_record</span>
|
613
|
+
|
614
|
+
|
615
|
+
<span class='type'></span>
|
616
|
+
|
617
|
+
|
618
|
+
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
619
|
+
|
620
|
+
|
621
|
+
—
|
622
|
+
<div class='inline'>
|
623
|
+
<p>of ORM specific type the record who causes the change, reacord must respond
|
624
|
+
to: id, updated_at, destroyed?</p>
|
625
|
+
</div>
|
626
|
+
|
627
|
+
</li>
|
628
|
+
|
629
|
+
</ul>
|
630
|
+
|
631
|
+
|
632
|
+
</div><table class="source_code">
|
633
|
+
<tr>
|
634
|
+
<td>
|
635
|
+
<pre class="lines">
|
636
|
+
|
637
|
+
|
638
|
+
358
|
639
|
+
359
|
640
|
+
360</pre>
|
641
|
+
</td>
|
642
|
+
<td>
|
643
|
+
<pre class="code"><span class="info file"># File 'lib/hyper_record/pub_sub.rb', line 358</span>
|
644
|
+
|
645
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_pub_sub_relation'>pub_sub_relation</span><span class='lparen'>(</span><span class='id identifier rubyid_relation'>relation</span><span class='comma'>,</span> <span class='id identifier rubyid_base_record'>base_record</span><span class='comma'>,</span> <span class='id identifier rubyid_relation_name'>relation_name</span><span class='comma'>,</span> <span class='id identifier rubyid_causing_record'>causing_record</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
646
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_pub_sub_relation'>pub_sub_relation</span><span class='lparen'>(</span><span class='id identifier rubyid_relation'>relation</span><span class='comma'>,</span> <span class='id identifier rubyid_base_record'>base_record</span><span class='comma'>,</span> <span class='id identifier rubyid_relation_name'>relation_name</span><span class='comma'>,</span> <span class='id identifier rubyid_causing_record'>causing_record</span><span class='rparen'>)</span>
|
647
|
+
<span class='kw'>end</span></pre>
|
648
|
+
</td>
|
649
|
+
</tr>
|
650
|
+
</table>
|
651
|
+
</div>
|
652
|
+
|
653
|
+
<div class="method_details ">
|
654
|
+
<h3 class="signature " id="pub_sub_rest_class_method-instance_method">
|
655
|
+
|
656
|
+
#<strong>pub_sub_rest_class_method</strong>(record_class, rest_class_method_name) ⇒ <tt>Object</tt>
|
657
|
+
|
658
|
+
|
659
|
+
|
660
|
+
|
661
|
+
|
662
|
+
</h3><div class="docstring">
|
663
|
+
<div class="discussion">
|
664
|
+
|
665
|
+
<p>subscribe to rest_class_method and then send message to notify clients that
|
666
|
+
they should call the rest_class_method again</p>
|
667
|
+
|
668
|
+
|
669
|
+
</div>
|
670
|
+
</div>
|
671
|
+
<div class="tags">
|
672
|
+
<p class="tag_title">Parameters:</p>
|
673
|
+
<ul class="param">
|
674
|
+
|
675
|
+
<li>
|
676
|
+
|
677
|
+
<span class='name'>record_class</span>
|
678
|
+
|
679
|
+
|
680
|
+
<span class='type'></span>
|
681
|
+
|
682
|
+
|
683
|
+
|
684
|
+
—
|
685
|
+
<div class='inline'>
|
686
|
+
<p>ORM specific</p>
|
687
|
+
</div>
|
688
|
+
|
689
|
+
</li>
|
690
|
+
|
691
|
+
<li>
|
692
|
+
|
693
|
+
<span class='name'>rest_class_method_name</span>
|
694
|
+
|
695
|
+
|
696
|
+
<span class='type'>(<tt>String</tt>)</span>
|
697
|
+
|
698
|
+
|
699
|
+
|
700
|
+
</li>
|
701
|
+
|
702
|
+
</ul>
|
703
|
+
|
704
|
+
|
705
|
+
</div><table class="source_code">
|
706
|
+
<tr>
|
707
|
+
<td>
|
708
|
+
<pre class="lines">
|
709
|
+
|
710
|
+
|
711
|
+
363
|
712
|
+
364
|
713
|
+
365</pre>
|
714
|
+
</td>
|
715
|
+
<td>
|
716
|
+
<pre class="code"><span class="info file"># File 'lib/hyper_record/pub_sub.rb', line 363</span>
|
717
|
+
|
718
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_pub_sub_rest_class_method'>pub_sub_rest_class_method</span><span class='lparen'>(</span><span class='id identifier rubyid_record_class'>record_class</span><span class='comma'>,</span> <span class='id identifier rubyid_rest_class_method_name'>rest_class_method_name</span><span class='rparen'>)</span>
|
719
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_pub_sub_rest_class_method'>pub_sub_rest_class_method</span><span class='lparen'>(</span><span class='id identifier rubyid_record_class'>record_class</span><span class='comma'>,</span> <span class='id identifier rubyid_rest_class_method_name'>rest_class_method_name</span><span class='rparen'>)</span>
|
720
|
+
<span class='kw'>end</span></pre>
|
721
|
+
</td>
|
722
|
+
</tr>
|
723
|
+
</table>
|
724
|
+
</div>
|
725
|
+
|
726
|
+
<div class="method_details ">
|
727
|
+
<h3 class="signature " id="pub_sub_rest_method-instance_method">
|
728
|
+
|
729
|
+
#<strong>pub_sub_rest_method</strong>(record, rest_method_name) ⇒ <tt>Object</tt>
|
730
|
+
|
731
|
+
|
732
|
+
|
733
|
+
|
734
|
+
|
735
|
+
</h3><div class="docstring">
|
736
|
+
<div class="discussion">
|
737
|
+
|
738
|
+
<p>subscribe to rest_method and then send message to notify clients that they
|
739
|
+
should call the rest_method again</p>
|
740
|
+
|
741
|
+
|
742
|
+
</div>
|
743
|
+
</div>
|
744
|
+
<div class="tags">
|
745
|
+
<p class="tag_title">Parameters:</p>
|
746
|
+
<ul class="param">
|
747
|
+
|
748
|
+
<li>
|
749
|
+
|
750
|
+
<span class='name'>record</span>
|
751
|
+
|
752
|
+
|
753
|
+
<span class='type'></span>
|
754
|
+
|
755
|
+
|
756
|
+
|
757
|
+
—
|
758
|
+
<div class='inline'>
|
759
|
+
<p>of ORM specific type</p>
|
760
|
+
</div>
|
761
|
+
|
762
|
+
</li>
|
763
|
+
|
764
|
+
<li>
|
765
|
+
|
766
|
+
<span class='name'>rest_method_name</span>
|
767
|
+
|
768
|
+
|
769
|
+
<span class='type'>(<tt>String</tt>)</span>
|
770
|
+
|
771
|
+
|
772
|
+
|
773
|
+
</li>
|
774
|
+
|
775
|
+
</ul>
|
776
|
+
|
777
|
+
|
778
|
+
</div><table class="source_code">
|
779
|
+
<tr>
|
780
|
+
<td>
|
781
|
+
<pre class="lines">
|
782
|
+
|
783
|
+
|
784
|
+
368
|
785
|
+
369
|
786
|
+
370</pre>
|
787
|
+
</td>
|
788
|
+
<td>
|
789
|
+
<pre class="code"><span class="info file"># File 'lib/hyper_record/pub_sub.rb', line 368</span>
|
790
|
+
|
791
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_pub_sub_rest_method'>pub_sub_rest_method</span><span class='lparen'>(</span><span class='id identifier rubyid_record'>record</span><span class='comma'>,</span> <span class='id identifier rubyid_rest_method_name'>rest_method_name</span><span class='rparen'>)</span>
|
792
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_pub_sub_rest_method'>pub_sub_rest_method</span><span class='lparen'>(</span><span class='id identifier rubyid_record'>record</span><span class='comma'>,</span> <span class='id identifier rubyid_rest_method_name'>rest_method_name</span><span class='rparen'>)</span>
|
793
|
+
<span class='kw'>end</span></pre>
|
794
|
+
</td>
|
795
|
+
</tr>
|
796
|
+
</table>
|
797
|
+
</div>
|
798
|
+
|
799
|
+
<div class="method_details ">
|
800
|
+
<h3 class="signature " id="pub_sub_scope-instance_method">
|
801
|
+
|
802
|
+
#<strong>pub_sub_scope</strong>(collection, record_class, scope_name) ⇒ <tt>Object</tt>
|
803
|
+
|
804
|
+
|
805
|
+
|
806
|
+
|
807
|
+
|
808
|
+
</h3><div class="docstring">
|
809
|
+
<div class="discussion">
|
810
|
+
|
811
|
+
<p>subscribe to scope changes and send message about scope change to all
|
812
|
+
subscribers</p>
|
813
|
+
|
814
|
+
|
815
|
+
</div>
|
816
|
+
</div>
|
817
|
+
<div class="tags">
|
818
|
+
<p class="tag_title">Parameters:</p>
|
819
|
+
<ul class="param">
|
820
|
+
|
821
|
+
<li>
|
822
|
+
|
823
|
+
<span class='name'>collection</span>
|
824
|
+
|
825
|
+
|
826
|
+
<span class='type'>(<tt>Enumerable</tt>)</span>
|
827
|
+
|
828
|
+
|
829
|
+
|
830
|
+
—
|
831
|
+
<div class='inline'>
|
832
|
+
<p>subscribe to each member of collection</p>
|
833
|
+
</div>
|
834
|
+
|
835
|
+
</li>
|
836
|
+
|
837
|
+
<li>
|
838
|
+
|
839
|
+
<span class='name'>record_class</span>
|
840
|
+
|
841
|
+
|
842
|
+
<span class='type'></span>
|
843
|
+
|
844
|
+
|
845
|
+
|
846
|
+
—
|
847
|
+
<div class='inline'>
|
848
|
+
<p>ORM specific</p>
|
849
|
+
</div>
|
850
|
+
|
851
|
+
</li>
|
852
|
+
|
853
|
+
<li>
|
854
|
+
|
855
|
+
<span class='name'>scope_name</span>
|
856
|
+
|
857
|
+
|
858
|
+
<span class='type'>(<tt>String</tt>)</span>
|
859
|
+
|
860
|
+
|
861
|
+
|
862
|
+
</li>
|
863
|
+
|
864
|
+
</ul>
|
865
|
+
|
866
|
+
|
867
|
+
</div><table class="source_code">
|
868
|
+
<tr>
|
869
|
+
<td>
|
870
|
+
<pre class="lines">
|
871
|
+
|
872
|
+
|
873
|
+
373
|
874
|
+
374
|
875
|
+
375</pre>
|
876
|
+
</td>
|
877
|
+
<td>
|
878
|
+
<pre class="code"><span class="info file"># File 'lib/hyper_record/pub_sub.rb', line 373</span>
|
879
|
+
|
880
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_pub_sub_scope'>pub_sub_scope</span><span class='lparen'>(</span><span class='id identifier rubyid_collection'>collection</span><span class='comma'>,</span> <span class='id identifier rubyid_record_class'>record_class</span><span class='comma'>,</span> <span class='id identifier rubyid_scope_name'>scope_name</span><span class='rparen'>)</span>
|
881
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_pub_sub_scope'>pub_sub_scope</span><span class='lparen'>(</span><span class='id identifier rubyid_collection'>collection</span><span class='comma'>,</span> <span class='id identifier rubyid_record_class'>record_class</span><span class='comma'>,</span> <span class='id identifier rubyid_scope_name'>scope_name</span><span class='rparen'>)</span>
|
882
|
+
<span class='kw'>end</span></pre>
|
883
|
+
</td>
|
884
|
+
</tr>
|
885
|
+
</table>
|
886
|
+
</div>
|
887
|
+
|
888
|
+
<div class="method_details ">
|
889
|
+
<h3 class="signature " id="publish_record-instance_method">
|
890
|
+
|
891
|
+
#<strong>publish_record</strong>(record) ⇒ <tt>Object</tt>
|
892
|
+
|
893
|
+
|
894
|
+
|
895
|
+
|
896
|
+
|
897
|
+
</h3><div class="docstring">
|
898
|
+
<div class="discussion">
|
899
|
+
|
900
|
+
<p>send message about record change to all subscribers of this record</p>
|
901
|
+
|
902
|
+
|
903
|
+
</div>
|
904
|
+
</div>
|
905
|
+
<div class="tags">
|
906
|
+
<p class="tag_title">Parameters:</p>
|
907
|
+
<ul class="param">
|
908
|
+
|
909
|
+
<li>
|
910
|
+
|
911
|
+
<span class='name'>record</span>
|
912
|
+
|
913
|
+
|
914
|
+
<span class='type'></span>
|
915
|
+
|
916
|
+
|
917
|
+
|
918
|
+
—
|
919
|
+
<div class='inline'>
|
920
|
+
<p>of ORM specific type, record must respond to: id, updated_at, destroyed?</p>
|
921
|
+
</div>
|
922
|
+
|
923
|
+
</li>
|
924
|
+
|
925
|
+
</ul>
|
926
|
+
|
927
|
+
|
928
|
+
</div><table class="source_code">
|
929
|
+
<tr>
|
930
|
+
<td>
|
931
|
+
<pre class="lines">
|
932
|
+
|
933
|
+
|
934
|
+
303
|
935
|
+
304
|
936
|
+
305</pre>
|
937
|
+
</td>
|
938
|
+
<td>
|
939
|
+
<pre class="code"><span class="info file"># File 'lib/hyper_record/pub_sub.rb', line 303</span>
|
940
|
+
|
941
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_publish_record'>publish_record</span><span class='lparen'>(</span><span class='id identifier rubyid_record'>record</span><span class='rparen'>)</span>
|
942
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_publish_record'>publish_record</span><span class='lparen'>(</span><span class='id identifier rubyid_record'>record</span><span class='rparen'>)</span>
|
943
|
+
<span class='kw'>end</span></pre>
|
944
|
+
</td>
|
945
|
+
</tr>
|
946
|
+
</table>
|
947
|
+
</div>
|
948
|
+
|
949
|
+
<div class="method_details ">
|
950
|
+
<h3 class="signature " id="publish_relation-instance_method">
|
951
|
+
|
952
|
+
#<strong>publish_relation</strong>(base_record, relation_name, record = nil) ⇒ <tt>Object</tt>
|
953
|
+
|
954
|
+
|
955
|
+
|
956
|
+
|
957
|
+
|
958
|
+
</h3><div class="docstring">
|
959
|
+
<div class="discussion">
|
960
|
+
|
961
|
+
<p>send message about relation change to all subscribers of this record</p>
|
962
|
+
|
963
|
+
|
964
|
+
</div>
|
965
|
+
</div>
|
966
|
+
<div class="tags">
|
967
|
+
<p class="tag_title">Parameters:</p>
|
968
|
+
<ul class="param">
|
969
|
+
|
970
|
+
<li>
|
971
|
+
|
972
|
+
<span class='name'>base_record</span>
|
973
|
+
|
974
|
+
|
975
|
+
<span class='type'></span>
|
976
|
+
|
977
|
+
|
978
|
+
|
979
|
+
—
|
980
|
+
<div class='inline'>
|
981
|
+
<p>of ORM specific type, base_record must respond to: id, updated_at,
|
982
|
+
destroyed?</p>
|
983
|
+
</div>
|
984
|
+
|
985
|
+
</li>
|
986
|
+
|
987
|
+
<li>
|
988
|
+
|
989
|
+
<span class='name'>relation_name</span>
|
990
|
+
|
991
|
+
|
992
|
+
<span class='type'>(<tt>String</tt>)</span>
|
993
|
+
|
994
|
+
|
995
|
+
|
996
|
+
</li>
|
997
|
+
|
998
|
+
<li>
|
999
|
+
|
1000
|
+
<span class='name'>record</span>
|
1001
|
+
|
1002
|
+
|
1003
|
+
<span class='type'></span>
|
1004
|
+
|
1005
|
+
|
1006
|
+
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
1007
|
+
|
1008
|
+
|
1009
|
+
—
|
1010
|
+
<div class='inline'>
|
1011
|
+
<p>of ORM specific type, the record who causes the change, record must respond
|
1012
|
+
to: id, updated_at, destroyed?</p>
|
1013
|
+
</div>
|
1014
|
+
|
1015
|
+
</li>
|
1016
|
+
|
1017
|
+
</ul>
|
1018
|
+
|
1019
|
+
|
1020
|
+
</div><table class="source_code">
|
1021
|
+
<tr>
|
1022
|
+
<td>
|
1023
|
+
<pre class="lines">
|
1024
|
+
|
1025
|
+
|
1026
|
+
308
|
1027
|
+
309
|
1028
|
+
310</pre>
|
1029
|
+
</td>
|
1030
|
+
<td>
|
1031
|
+
<pre class="code"><span class="info file"># File 'lib/hyper_record/pub_sub.rb', line 308</span>
|
1032
|
+
|
1033
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_publish_relation'>publish_relation</span><span class='lparen'>(</span><span class='id identifier rubyid_base_record'>base_record</span><span class='comma'>,</span> <span class='id identifier rubyid_relation_name'>relation_name</span><span class='comma'>,</span> <span class='id identifier rubyid_record'>record</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
1034
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_publish_relation'>publish_relation</span><span class='lparen'>(</span><span class='id identifier rubyid_base_record'>base_record</span><span class='comma'>,</span> <span class='id identifier rubyid_relation_name'>relation_name</span><span class='comma'>,</span> <span class='id identifier rubyid_record'>record</span><span class='rparen'>)</span>
|
1035
|
+
<span class='kw'>end</span></pre>
|
1036
|
+
</td>
|
1037
|
+
</tr>
|
1038
|
+
</table>
|
1039
|
+
</div>
|
1040
|
+
|
1041
|
+
<div class="method_details ">
|
1042
|
+
<h3 class="signature " id="publish_rest_class_method-instance_method">
|
1043
|
+
|
1044
|
+
#<strong>publish_rest_class_method</strong>(record_class, rest_class_method_name) ⇒ <tt>Object</tt>
|
1045
|
+
|
1046
|
+
|
1047
|
+
|
1048
|
+
|
1049
|
+
|
1050
|
+
</h3><div class="docstring">
|
1051
|
+
<div class="discussion">
|
1052
|
+
|
1053
|
+
<p>send message to notify clients that they should call the rest_class_method
|
1054
|
+
again</p>
|
1055
|
+
|
1056
|
+
|
1057
|
+
</div>
|
1058
|
+
</div>
|
1059
|
+
<div class="tags">
|
1060
|
+
<p class="tag_title">Parameters:</p>
|
1061
|
+
<ul class="param">
|
1062
|
+
|
1063
|
+
<li>
|
1064
|
+
|
1065
|
+
<span class='name'>record_class</span>
|
1066
|
+
|
1067
|
+
|
1068
|
+
<span class='type'></span>
|
1069
|
+
|
1070
|
+
|
1071
|
+
|
1072
|
+
—
|
1073
|
+
<div class='inline'>
|
1074
|
+
<p>ORM specific</p>
|
1075
|
+
</div>
|
1076
|
+
|
1077
|
+
</li>
|
1078
|
+
|
1079
|
+
<li>
|
1080
|
+
|
1081
|
+
<span class='name'>rest_class_method_name</span>
|
1082
|
+
|
1083
|
+
|
1084
|
+
<span class='type'>(<tt>String</tt>)</span>
|
1085
|
+
|
1086
|
+
|
1087
|
+
|
1088
|
+
</li>
|
1089
|
+
|
1090
|
+
</ul>
|
1091
|
+
|
1092
|
+
|
1093
|
+
</div><table class="source_code">
|
1094
|
+
<tr>
|
1095
|
+
<td>
|
1096
|
+
<pre class="lines">
|
1097
|
+
|
1098
|
+
|
1099
|
+
313
|
1100
|
+
314
|
1101
|
+
315</pre>
|
1102
|
+
</td>
|
1103
|
+
<td>
|
1104
|
+
<pre class="code"><span class="info file"># File 'lib/hyper_record/pub_sub.rb', line 313</span>
|
1105
|
+
|
1106
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_publish_rest_class_method'>publish_rest_class_method</span><span class='lparen'>(</span><span class='id identifier rubyid_record_class'>record_class</span><span class='comma'>,</span> <span class='id identifier rubyid_rest_class_method_name'>rest_class_method_name</span><span class='rparen'>)</span>
|
1107
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_publish_rest_class_method'>publish_rest_class_method</span><span class='lparen'>(</span><span class='id identifier rubyid_record_class'>record_class</span><span class='comma'>,</span> <span class='id identifier rubyid_rest_class_method_name'>rest_class_method_name</span><span class='rparen'>)</span>
|
1108
|
+
<span class='kw'>end</span></pre>
|
1109
|
+
</td>
|
1110
|
+
</tr>
|
1111
|
+
</table>
|
1112
|
+
</div>
|
1113
|
+
|
1114
|
+
<div class="method_details ">
|
1115
|
+
<h3 class="signature " id="publish_rest_method-instance_method">
|
1116
|
+
|
1117
|
+
#<strong>publish_rest_method</strong>(record, rest_method_name) ⇒ <tt>Object</tt>
|
1118
|
+
|
1119
|
+
|
1120
|
+
|
1121
|
+
|
1122
|
+
|
1123
|
+
</h3><div class="docstring">
|
1124
|
+
<div class="discussion">
|
1125
|
+
|
1126
|
+
<p>send message to notify clients that they should call the rest_method again</p>
|
1127
|
+
|
1128
|
+
|
1129
|
+
</div>
|
1130
|
+
</div>
|
1131
|
+
<div class="tags">
|
1132
|
+
<p class="tag_title">Parameters:</p>
|
1133
|
+
<ul class="param">
|
1134
|
+
|
1135
|
+
<li>
|
1136
|
+
|
1137
|
+
<span class='name'>record</span>
|
1138
|
+
|
1139
|
+
|
1140
|
+
<span class='type'></span>
|
1141
|
+
|
1142
|
+
|
1143
|
+
|
1144
|
+
—
|
1145
|
+
<div class='inline'>
|
1146
|
+
<p>of ORM specific type</p>
|
1147
|
+
</div>
|
1148
|
+
|
1149
|
+
</li>
|
1150
|
+
|
1151
|
+
<li>
|
1152
|
+
|
1153
|
+
<span class='name'>rest_method_name</span>
|
1154
|
+
|
1155
|
+
|
1156
|
+
<span class='type'>(<tt>String</tt>)</span>
|
1157
|
+
|
1158
|
+
|
1159
|
+
|
1160
|
+
</li>
|
1161
|
+
|
1162
|
+
</ul>
|
1163
|
+
|
1164
|
+
|
1165
|
+
</div><table class="source_code">
|
1166
|
+
<tr>
|
1167
|
+
<td>
|
1168
|
+
<pre class="lines">
|
1169
|
+
|
1170
|
+
|
1171
|
+
318
|
1172
|
+
319
|
1173
|
+
320</pre>
|
1174
|
+
</td>
|
1175
|
+
<td>
|
1176
|
+
<pre class="code"><span class="info file"># File 'lib/hyper_record/pub_sub.rb', line 318</span>
|
1177
|
+
|
1178
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_publish_rest_method'>publish_rest_method</span><span class='lparen'>(</span><span class='id identifier rubyid_record'>record</span><span class='comma'>,</span> <span class='id identifier rubyid_rest_method_name'>rest_method_name</span><span class='rparen'>)</span>
|
1179
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_publish_rest_method'>publish_rest_method</span><span class='lparen'>(</span><span class='id identifier rubyid_record'>record</span><span class='comma'>,</span> <span class='id identifier rubyid_rest_method_name'>rest_method_name</span><span class='rparen'>)</span>
|
1180
|
+
<span class='kw'>end</span></pre>
|
1181
|
+
</td>
|
1182
|
+
</tr>
|
1183
|
+
</table>
|
1184
|
+
</div>
|
1185
|
+
|
1186
|
+
<div class="method_details ">
|
1187
|
+
<h3 class="signature " id="publish_scope-instance_method">
|
1188
|
+
|
1189
|
+
#<strong>publish_scope</strong>(record_class, scope_name) ⇒ <tt>Object</tt>
|
1190
|
+
|
1191
|
+
|
1192
|
+
|
1193
|
+
|
1194
|
+
|
1195
|
+
</h3><div class="docstring">
|
1196
|
+
<div class="discussion">
|
1197
|
+
|
1198
|
+
<p>send message about scope change to all subscribers</p>
|
1199
|
+
|
1200
|
+
|
1201
|
+
</div>
|
1202
|
+
</div>
|
1203
|
+
<div class="tags">
|
1204
|
+
<p class="tag_title">Parameters:</p>
|
1205
|
+
<ul class="param">
|
1206
|
+
|
1207
|
+
<li>
|
1208
|
+
|
1209
|
+
<span class='name'>record_class</span>
|
1210
|
+
|
1211
|
+
|
1212
|
+
<span class='type'></span>
|
1213
|
+
|
1214
|
+
|
1215
|
+
|
1216
|
+
—
|
1217
|
+
<div class='inline'>
|
1218
|
+
<p>ORM specific</p>
|
1219
|
+
</div>
|
1220
|
+
|
1221
|
+
</li>
|
1222
|
+
|
1223
|
+
<li>
|
1224
|
+
|
1225
|
+
<span class='name'>scope_name</span>
|
1226
|
+
|
1227
|
+
|
1228
|
+
<span class='type'>(<tt>String</tt>)</span>
|
1229
|
+
|
1230
|
+
|
1231
|
+
|
1232
|
+
</li>
|
1233
|
+
|
1234
|
+
</ul>
|
1235
|
+
|
1236
|
+
|
1237
|
+
</div><table class="source_code">
|
1238
|
+
<tr>
|
1239
|
+
<td>
|
1240
|
+
<pre class="lines">
|
1241
|
+
|
1242
|
+
|
1243
|
+
323
|
1244
|
+
324
|
1245
|
+
325</pre>
|
1246
|
+
</td>
|
1247
|
+
<td>
|
1248
|
+
<pre class="code"><span class="info file"># File 'lib/hyper_record/pub_sub.rb', line 323</span>
|
1249
|
+
|
1250
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_publish_scope'>publish_scope</span><span class='lparen'>(</span><span class='id identifier rubyid_record_class'>record_class</span><span class='comma'>,</span> <span class='id identifier rubyid_scope_name'>scope_name</span><span class='rparen'>)</span>
|
1251
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_publish_scope'>publish_scope</span><span class='lparen'>(</span><span class='id identifier rubyid_record_class'>record_class</span><span class='comma'>,</span> <span class='id identifier rubyid_scope_name'>scope_name</span><span class='rparen'>)</span>
|
1252
|
+
<span class='kw'>end</span></pre>
|
1253
|
+
</td>
|
1254
|
+
</tr>
|
1255
|
+
</table>
|
1256
|
+
</div>
|
1257
|
+
|
1258
|
+
<div class="method_details ">
|
1259
|
+
<h3 class="signature " id="subscribe_record-instance_method">
|
1260
|
+
|
1261
|
+
#<strong>subscribe_record</strong>(record) ⇒ <tt>Object</tt>
|
1262
|
+
|
1263
|
+
|
1264
|
+
|
1265
|
+
|
1266
|
+
|
1267
|
+
</h3><div class="docstring">
|
1268
|
+
<div class="discussion">
|
1269
|
+
|
1270
|
+
<p>subscribe to record changes</p>
|
1271
|
+
|
1272
|
+
|
1273
|
+
</div>
|
1274
|
+
</div>
|
1275
|
+
<div class="tags">
|
1276
|
+
<p class="tag_title">Parameters:</p>
|
1277
|
+
<ul class="param">
|
1278
|
+
|
1279
|
+
<li>
|
1280
|
+
|
1281
|
+
<span class='name'>record</span>
|
1282
|
+
|
1283
|
+
|
1284
|
+
<span class='type'></span>
|
1285
|
+
|
1286
|
+
|
1287
|
+
|
1288
|
+
—
|
1289
|
+
<div class='inline'>
|
1290
|
+
<p>of ORM specific type</p>
|
1291
|
+
</div>
|
1292
|
+
|
1293
|
+
</li>
|
1294
|
+
|
1295
|
+
</ul>
|
1296
|
+
|
1297
|
+
|
1298
|
+
</div><table class="source_code">
|
1299
|
+
<tr>
|
1300
|
+
<td>
|
1301
|
+
<pre class="lines">
|
1302
|
+
|
1303
|
+
|
1304
|
+
328
|
1305
|
+
329
|
1306
|
+
330</pre>
|
1307
|
+
</td>
|
1308
|
+
<td>
|
1309
|
+
<pre class="code"><span class="info file"># File 'lib/hyper_record/pub_sub.rb', line 328</span>
|
1310
|
+
|
1311
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_subscribe_record'>subscribe_record</span><span class='lparen'>(</span><span class='id identifier rubyid_record'>record</span><span class='rparen'>)</span>
|
1312
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_subscribe_record'>subscribe_record</span><span class='lparen'>(</span><span class='id identifier rubyid_record'>record</span><span class='rparen'>)</span>
|
1313
|
+
<span class='kw'>end</span></pre>
|
1314
|
+
</td>
|
1315
|
+
</tr>
|
1316
|
+
</table>
|
1317
|
+
</div>
|
1318
|
+
|
1319
|
+
<div class="method_details ">
|
1320
|
+
<h3 class="signature " id="subscribe_relation-instance_method">
|
1321
|
+
|
1322
|
+
#<strong>subscribe_relation</strong>(relation, base_record = nil, relation_name = nil) ⇒ <tt>Object</tt>
|
1323
|
+
|
1324
|
+
|
1325
|
+
|
1326
|
+
|
1327
|
+
|
1328
|
+
</h3><div class="docstring">
|
1329
|
+
<div class="discussion">
|
1330
|
+
|
1331
|
+
<p>subscribe to relation changes</p>
|
1332
|
+
|
1333
|
+
|
1334
|
+
</div>
|
1335
|
+
</div>
|
1336
|
+
<div class="tags">
|
1337
|
+
<p class="tag_title">Parameters:</p>
|
1338
|
+
<ul class="param">
|
1339
|
+
|
1340
|
+
<li>
|
1341
|
+
|
1342
|
+
<span class='name'>relation</span>
|
1343
|
+
|
1344
|
+
|
1345
|
+
<span class='type'>(<tt>Enumarable</tt>)</span>
|
1346
|
+
|
1347
|
+
|
1348
|
+
|
1349
|
+
—
|
1350
|
+
<div class='inline'>
|
1351
|
+
<p>or record of ORM specific type, subscribe to each member of relation</p>
|
1352
|
+
</div>
|
1353
|
+
|
1354
|
+
</li>
|
1355
|
+
|
1356
|
+
<li>
|
1357
|
+
|
1358
|
+
<span class='name'>base_record</span>
|
1359
|
+
|
1360
|
+
|
1361
|
+
<span class='type'></span>
|
1362
|
+
|
1363
|
+
|
1364
|
+
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
1365
|
+
|
1366
|
+
|
1367
|
+
—
|
1368
|
+
<div class='inline'>
|
1369
|
+
<p>optional, of ORM specific type, subscribe to this base_record too</p>
|
1370
|
+
</div>
|
1371
|
+
|
1372
|
+
</li>
|
1373
|
+
|
1374
|
+
<li>
|
1375
|
+
|
1376
|
+
<span class='name'>relation_name</span>
|
1377
|
+
|
1378
|
+
|
1379
|
+
<span class='type'>(<tt>String</tt>)</span>
|
1380
|
+
|
1381
|
+
|
1382
|
+
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
1383
|
+
|
1384
|
+
|
1385
|
+
—
|
1386
|
+
<div class='inline'>
|
1387
|
+
<p>optional name of the relation</p>
|
1388
|
+
</div>
|
1389
|
+
|
1390
|
+
</li>
|
1391
|
+
|
1392
|
+
</ul>
|
1393
|
+
|
1394
|
+
|
1395
|
+
</div><table class="source_code">
|
1396
|
+
<tr>
|
1397
|
+
<td>
|
1398
|
+
<pre class="lines">
|
1399
|
+
|
1400
|
+
|
1401
|
+
333
|
1402
|
+
334
|
1403
|
+
335</pre>
|
1404
|
+
</td>
|
1405
|
+
<td>
|
1406
|
+
<pre class="code"><span class="info file"># File 'lib/hyper_record/pub_sub.rb', line 333</span>
|
1407
|
+
|
1408
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_subscribe_relation'>subscribe_relation</span><span class='lparen'>(</span><span class='id identifier rubyid_relation'>relation</span><span class='comma'>,</span> <span class='id identifier rubyid_base_record'>base_record</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_relation_name'>relation_name</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
1409
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_subscribe_relation'>subscribe_relation</span><span class='lparen'>(</span><span class='id identifier rubyid_relation'>relation</span><span class='comma'>,</span> <span class='id identifier rubyid_base_record'>base_record</span><span class='comma'>,</span> <span class='id identifier rubyid_relation_name'>relation_name</span><span class='rparen'>)</span>
|
1410
|
+
<span class='kw'>end</span></pre>
|
1411
|
+
</td>
|
1412
|
+
</tr>
|
1413
|
+
</table>
|
1414
|
+
</div>
|
1415
|
+
|
1416
|
+
<div class="method_details ">
|
1417
|
+
<h3 class="signature " id="subscribe_rest_class_method-instance_method">
|
1418
|
+
|
1419
|
+
#<strong>subscribe_rest_class_method</strong>(record_class, rest_class_method_name) ⇒ <tt>Object</tt>
|
1420
|
+
|
1421
|
+
|
1422
|
+
|
1423
|
+
|
1424
|
+
|
1425
|
+
</h3><div class="docstring">
|
1426
|
+
<div class="discussion">
|
1427
|
+
|
1428
|
+
<p>subscribe to rest_class_method updates</p>
|
1429
|
+
|
1430
|
+
|
1431
|
+
</div>
|
1432
|
+
</div>
|
1433
|
+
<div class="tags">
|
1434
|
+
<p class="tag_title">Parameters:</p>
|
1435
|
+
<ul class="param">
|
1436
|
+
|
1437
|
+
<li>
|
1438
|
+
|
1439
|
+
<span class='name'>record_class</span>
|
1440
|
+
|
1441
|
+
|
1442
|
+
<span class='type'></span>
|
1443
|
+
|
1444
|
+
|
1445
|
+
|
1446
|
+
—
|
1447
|
+
<div class='inline'>
|
1448
|
+
<p>ORM specific</p>
|
1449
|
+
</div>
|
1450
|
+
|
1451
|
+
</li>
|
1452
|
+
|
1453
|
+
<li>
|
1454
|
+
|
1455
|
+
<span class='name'>rest_class_method_name</span>
|
1456
|
+
|
1457
|
+
|
1458
|
+
<span class='type'>(<tt>String</tt>)</span>
|
1459
|
+
|
1460
|
+
|
1461
|
+
|
1462
|
+
—
|
1463
|
+
<div class='inline'>
|
1464
|
+
<p>name of the rest_class_method</p>
|
1465
|
+
</div>
|
1466
|
+
|
1467
|
+
</li>
|
1468
|
+
|
1469
|
+
</ul>
|
1470
|
+
|
1471
|
+
|
1472
|
+
</div><table class="source_code">
|
1473
|
+
<tr>
|
1474
|
+
<td>
|
1475
|
+
<pre class="lines">
|
1476
|
+
|
1477
|
+
|
1478
|
+
338
|
1479
|
+
339
|
1480
|
+
340</pre>
|
1481
|
+
</td>
|
1482
|
+
<td>
|
1483
|
+
<pre class="code"><span class="info file"># File 'lib/hyper_record/pub_sub.rb', line 338</span>
|
1484
|
+
|
1485
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_subscribe_rest_class_method'>subscribe_rest_class_method</span><span class='lparen'>(</span><span class='id identifier rubyid_record_class'>record_class</span><span class='comma'>,</span> <span class='id identifier rubyid_rest_class_method_name'>rest_class_method_name</span><span class='rparen'>)</span>
|
1486
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_subscribe_rest_class_method'>subscribe_rest_class_method</span><span class='lparen'>(</span><span class='id identifier rubyid_record_class'>record_class</span><span class='comma'>,</span> <span class='id identifier rubyid_rest_class_method_name'>rest_class_method_name</span><span class='rparen'>)</span>
|
1487
|
+
<span class='kw'>end</span></pre>
|
1488
|
+
</td>
|
1489
|
+
</tr>
|
1490
|
+
</table>
|
1491
|
+
</div>
|
1492
|
+
|
1493
|
+
<div class="method_details ">
|
1494
|
+
<h3 class="signature " id="subscribe_rest_method-instance_method">
|
1495
|
+
|
1496
|
+
#<strong>subscribe_rest_method</strong>(record, rest_method_name) ⇒ <tt>Object</tt>
|
1497
|
+
|
1498
|
+
|
1499
|
+
|
1500
|
+
|
1501
|
+
|
1502
|
+
</h3><div class="docstring">
|
1503
|
+
<div class="discussion">
|
1504
|
+
|
1505
|
+
<p>subscribe to rest_method updates</p>
|
1506
|
+
|
1507
|
+
|
1508
|
+
</div>
|
1509
|
+
</div>
|
1510
|
+
<div class="tags">
|
1511
|
+
<p class="tag_title">Parameters:</p>
|
1512
|
+
<ul class="param">
|
1513
|
+
|
1514
|
+
<li>
|
1515
|
+
|
1516
|
+
<span class='name'>record</span>
|
1517
|
+
|
1518
|
+
|
1519
|
+
<span class='type'></span>
|
1520
|
+
|
1521
|
+
|
1522
|
+
|
1523
|
+
—
|
1524
|
+
<div class='inline'>
|
1525
|
+
<p>of ORM specific type</p>
|
1526
|
+
</div>
|
1527
|
+
|
1528
|
+
</li>
|
1529
|
+
|
1530
|
+
<li>
|
1531
|
+
|
1532
|
+
<span class='name'>rest_method_name</span>
|
1533
|
+
|
1534
|
+
|
1535
|
+
<span class='type'>(<tt>String</tt>)</span>
|
1536
|
+
|
1537
|
+
|
1538
|
+
|
1539
|
+
—
|
1540
|
+
<div class='inline'>
|
1541
|
+
<p>name of the rest_method</p>
|
1542
|
+
</div>
|
1543
|
+
|
1544
|
+
</li>
|
1545
|
+
|
1546
|
+
</ul>
|
1547
|
+
|
1548
|
+
|
1549
|
+
</div><table class="source_code">
|
1550
|
+
<tr>
|
1551
|
+
<td>
|
1552
|
+
<pre class="lines">
|
1553
|
+
|
1554
|
+
|
1555
|
+
343
|
1556
|
+
344
|
1557
|
+
345</pre>
|
1558
|
+
</td>
|
1559
|
+
<td>
|
1560
|
+
<pre class="code"><span class="info file"># File 'lib/hyper_record/pub_sub.rb', line 343</span>
|
1561
|
+
|
1562
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_subscribe_rest_method'>subscribe_rest_method</span><span class='lparen'>(</span><span class='id identifier rubyid_record'>record</span><span class='comma'>,</span> <span class='id identifier rubyid_rest_method_name'>rest_method_name</span><span class='rparen'>)</span>
|
1563
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_subscribe_rest_method'>subscribe_rest_method</span><span class='lparen'>(</span><span class='id identifier rubyid_record'>record</span><span class='comma'>,</span> <span class='id identifier rubyid_rest_method_name'>rest_method_name</span><span class='rparen'>)</span>
|
1564
|
+
<span class='kw'>end</span></pre>
|
1565
|
+
</td>
|
1566
|
+
</tr>
|
1567
|
+
</table>
|
1568
|
+
</div>
|
1569
|
+
|
1570
|
+
<div class="method_details ">
|
1571
|
+
<h3 class="signature " id="subscribe_scope-instance_method">
|
1572
|
+
|
1573
|
+
#<strong>subscribe_scope</strong>(collection, record_class = nil, scope_name = nil) ⇒ <tt>Object</tt>
|
1574
|
+
|
1575
|
+
|
1576
|
+
|
1577
|
+
|
1578
|
+
|
1579
|
+
</h3><div class="docstring">
|
1580
|
+
<div class="discussion">
|
1581
|
+
|
1582
|
+
<p>subscribe to scope updates</p>
|
1583
|
+
|
1584
|
+
|
1585
|
+
</div>
|
1586
|
+
</div>
|
1587
|
+
<div class="tags">
|
1588
|
+
<p class="tag_title">Parameters:</p>
|
1589
|
+
<ul class="param">
|
1590
|
+
|
1591
|
+
<li>
|
1592
|
+
|
1593
|
+
<span class='name'>collection</span>
|
1594
|
+
|
1595
|
+
|
1596
|
+
<span class='type'>(<tt>Enumerable</tt>)</span>
|
1597
|
+
|
1598
|
+
|
1599
|
+
|
1600
|
+
—
|
1601
|
+
<div class='inline'>
|
1602
|
+
<p>subscribe to each member of collection</p>
|
1603
|
+
</div>
|
1604
|
+
|
1605
|
+
</li>
|
1606
|
+
|
1607
|
+
<li>
|
1608
|
+
|
1609
|
+
<span class='name'>record_class</span>
|
1610
|
+
|
1611
|
+
|
1612
|
+
<span class='type'></span>
|
1613
|
+
|
1614
|
+
|
1615
|
+
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
1616
|
+
|
1617
|
+
|
1618
|
+
—
|
1619
|
+
<div class='inline'>
|
1620
|
+
<p>optional, ORM specific</p>
|
1621
|
+
</div>
|
1622
|
+
|
1623
|
+
</li>
|
1624
|
+
|
1625
|
+
<li>
|
1626
|
+
|
1627
|
+
<span class='name'>scope_name</span>
|
1628
|
+
|
1629
|
+
|
1630
|
+
<span class='type'>(<tt>String</tt>)</span>
|
1631
|
+
|
1632
|
+
|
1633
|
+
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
1634
|
+
|
1635
|
+
|
1636
|
+
—
|
1637
|
+
<div class='inline'>
|
1638
|
+
<p>optional</p>
|
1639
|
+
</div>
|
1640
|
+
|
1641
|
+
</li>
|
1642
|
+
|
1643
|
+
</ul>
|
1644
|
+
|
1645
|
+
|
1646
|
+
</div><table class="source_code">
|
1647
|
+
<tr>
|
1648
|
+
<td>
|
1649
|
+
<pre class="lines">
|
1650
|
+
|
1651
|
+
|
1652
|
+
348
|
1653
|
+
349
|
1654
|
+
350</pre>
|
1655
|
+
</td>
|
1656
|
+
<td>
|
1657
|
+
<pre class="code"><span class="info file"># File 'lib/hyper_record/pub_sub.rb', line 348</span>
|
1658
|
+
|
1659
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_subscribe_scope'>subscribe_scope</span><span class='lparen'>(</span><span class='id identifier rubyid_collection'>collection</span><span class='comma'>,</span> <span class='id identifier rubyid_record_class'>record_class</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_scope_name'>scope_name</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
1660
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_subscribe_scope'>subscribe_scope</span><span class='lparen'>(</span><span class='id identifier rubyid_collection'>collection</span><span class='comma'>,</span> <span class='id identifier rubyid_record_class'>record_class</span><span class='comma'>,</span> <span class='id identifier rubyid_scope_name'>scope_name</span><span class='rparen'>)</span>
|
1661
|
+
<span class='kw'>end</span></pre>
|
1662
|
+
</td>
|
1663
|
+
</tr>
|
1664
|
+
</table>
|
1665
|
+
</div>
|
1666
|
+
|
1667
|
+
</div>
|
1668
|
+
|
1669
|
+
</div>
|
1670
|
+
|
1671
|
+
<div id="footer">
|
1672
|
+
Generated on Tue Jun 5 23:13:52 2018 by
|
1673
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1674
|
+
0.9.13 (ruby-2.5.1).
|
1675
|
+
</div>
|
1676
|
+
|
1677
|
+
</div>
|
1678
|
+
</body>
|
1679
|
+
</html>
|