notifyhub 0.0.1
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/CHANGELOG.rdoc +3 -0
- data/LICENSE +20 -0
- data/README.rdoc +19 -0
- data/Rakefile +28 -0
- data/doc/Master.html +396 -0
- data/doc/Notify.html +432 -0
- data/doc/NotifyHub/NotFound.html +134 -0
- data/doc/NotifyHub/Redefining.html +134 -0
- data/doc/NotifyHub.html +1312 -0
- data/doc/NotifySet.html +762 -0
- data/doc/_index.html +145 -0
- data/doc/class_list.html +53 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +57 -0
- data/doc/css/style.css +338 -0
- data/doc/file.CHANGELOG.html +79 -0
- data/doc/file.README.html +93 -0
- data/doc/file_list.html +58 -0
- data/doc/frames.html +28 -0
- data/doc/index.html +93 -0
- data/doc/js/app.js +214 -0
- data/doc/js/full_list.js +178 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +178 -0
- data/doc/top-level-namespace.html +112 -0
- data/lib/notifyhub.rb +339 -0
- data/test/test_notifyhub.rb +229 -0
- metadata +92 -0
data/doc/NotifyHub.html
ADDED
@@ -0,0 +1,1312 @@
|
|
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
|
+
Class: NotifyHub
|
8
|
+
|
9
|
+
— Documentation by YARD 0.8.6.1
|
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
|
+
hasFrames = window.top.frames.main ? true : false;
|
19
|
+
relpath = '';
|
20
|
+
framesUrl = "frames.html#!" + escape(window.location.href);
|
21
|
+
</script>
|
22
|
+
|
23
|
+
|
24
|
+
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
25
|
+
|
26
|
+
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
|
27
|
+
|
28
|
+
|
29
|
+
</head>
|
30
|
+
<body>
|
31
|
+
<div id="header">
|
32
|
+
<div id="menu">
|
33
|
+
|
34
|
+
<a href="_index.html">Index (N)</a> »
|
35
|
+
|
36
|
+
|
37
|
+
<span class="title">NotifyHub</span>
|
38
|
+
|
39
|
+
|
40
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
41
|
+
</div>
|
42
|
+
|
43
|
+
<div id="search">
|
44
|
+
|
45
|
+
<a class="full_list_link" id="class_list_link"
|
46
|
+
href="class_list.html">
|
47
|
+
Class List
|
48
|
+
</a>
|
49
|
+
|
50
|
+
<a class="full_list_link" id="method_list_link"
|
51
|
+
href="method_list.html">
|
52
|
+
Method List
|
53
|
+
</a>
|
54
|
+
|
55
|
+
<a class="full_list_link" id="file_list_link"
|
56
|
+
href="file_list.html">
|
57
|
+
File List
|
58
|
+
</a>
|
59
|
+
|
60
|
+
</div>
|
61
|
+
<div class="clear"></div>
|
62
|
+
</div>
|
63
|
+
|
64
|
+
<iframe id="search_frame"></iframe>
|
65
|
+
|
66
|
+
<div id="content"><h1>Class: NotifyHub
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
</h1>
|
71
|
+
|
72
|
+
<dl class="box">
|
73
|
+
|
74
|
+
<dt class="r1">Inherits:</dt>
|
75
|
+
<dd class="r1">
|
76
|
+
<span class="inheritName">Object</span>
|
77
|
+
|
78
|
+
<ul class="fullTree">
|
79
|
+
<li>Object</li>
|
80
|
+
|
81
|
+
<li class="next">NotifyHub</li>
|
82
|
+
|
83
|
+
</ul>
|
84
|
+
<a href="#" class="inheritanceTree">show all</a>
|
85
|
+
|
86
|
+
</dd>
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
<dt class="r2 last">Defined in:</dt>
|
97
|
+
<dd class="r2 last">lib/notifyhub.rb</dd>
|
98
|
+
|
99
|
+
</dl>
|
100
|
+
<div class="clear"></div>
|
101
|
+
|
102
|
+
<h2>Overview</h2><div class="docstring">
|
103
|
+
<div class="discussion">
|
104
|
+
|
105
|
+
<p>NotifyHub is a callback facility. NotifyHub is used by the informer to
|
106
|
+
notify clients about arbitrary events in the informer. NotifyHub contains
|
107
|
+
notification sets (NotifySet).</p>
|
108
|
+
|
109
|
+
<p>NotifySet is identified by set ID and it can include one or many
|
110
|
+
notifications (Notify). Client defines the action performed at notification
|
111
|
+
(callback). Informer activates the notification when notification events
|
112
|
+
occur.</p>
|
113
|
+
|
114
|
+
<p>Notifications can be enabled/disabled on different levels (NotifyHub,
|
115
|
+
NotifySet, and Notify).</p>
|
116
|
+
|
117
|
+
<p>Example:</p>
|
118
|
+
|
119
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>notifyhub</span><span class='tstring_end'>'</span></span>
|
120
|
+
|
121
|
+
<span class='comment'># Create class that includes interesting events.
|
122
|
+
</span><span class='kw'>class</span> <span class='const'>Storage</span>
|
123
|
+
|
124
|
+
<span class='comment'># Handle to NotifyHub.
|
125
|
+
</span> <span class='id identifier rubyid_attr_accessor'>attr_accessor</span> <span class='symbol'>:hub</span>
|
126
|
+
|
127
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span>
|
128
|
+
<span class='comment'># Create NotifyHub.
|
129
|
+
</span> <span class='ivar'>@hub</span> <span class='op'>=</span> <span class='const'>NotifyHub</span><span class='period'>.</span><span class='id identifier rubyid_declare'>declare</span><span class='lparen'>(</span> <span class='symbol'>:store</span><span class='comma'>,</span> <span class='symbol'>:load</span><span class='comma'>,</span> <span class='symbol'>:na</span> <span class='rparen'>)</span>
|
130
|
+
<span class='kw'>end</span>
|
131
|
+
|
132
|
+
<span class='comment'># Store data and notify clients.
|
133
|
+
</span> <span class='kw'>def</span> <span class='id identifier rubyid_store'>store</span><span class='lparen'>(</span> <span class='id identifier rubyid_data'>data</span> <span class='rparen'>)</span>
|
134
|
+
<span class='ivar'>@data</span> <span class='op'>=</span> <span class='id identifier rubyid_data'>data</span>
|
135
|
+
<span class='ivar'>@hub</span><span class='lbracket'>[</span> <span class='symbol'>:store</span> <span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_notify'>notify</span><span class='lparen'>(</span> <span class='ivar'>@data</span> <span class='rparen'>)</span>
|
136
|
+
<span class='kw'>end</span>
|
137
|
+
|
138
|
+
<span class='comment'># Load data and notify clients.
|
139
|
+
</span> <span class='kw'>def</span> <span class='id identifier rubyid_load'>load</span>
|
140
|
+
<span class='ivar'>@hub</span><span class='lbracket'>[</span> <span class='symbol'>:load</span> <span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_notify'>notify</span><span class='lparen'>(</span> <span class='ivar'>@data</span> <span class='rparen'>)</span>
|
141
|
+
<span class='ivar'>@data</span>
|
142
|
+
<span class='kw'>end</span>
|
143
|
+
<span class='kw'>end</span>
|
144
|
+
|
145
|
+
<span class='id identifier rubyid_storage'>storage</span> <span class='op'>=</span> <span class='const'>Storage</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
146
|
+
|
147
|
+
<span class='comment'># Setup notify action for store.
|
148
|
+
</span><span class='id identifier rubyid_storage'>storage</span><span class='period'>.</span><span class='id identifier rubyid_hub'>hub</span><span class='lbracket'>[</span> <span class='symbol'>:store</span> <span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_action'>action</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_data'>data</span><span class='op'>|</span>
|
149
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>store: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_data'>data</span><span class='rbrace'>}</span><span class='tstring_end'>"</span></span>
|
150
|
+
<span class='kw'>end</span>
|
151
|
+
|
152
|
+
<span class='comment'># Setup notify action for load.
|
153
|
+
</span><span class='id identifier rubyid_storage'>storage</span><span class='period'>.</span><span class='id identifier rubyid_hub'>hub</span><span class='lbracket'>[</span> <span class='symbol'>:load</span> <span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_action'>action</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_data'>data</span><span class='op'>|</span>
|
154
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>load: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_data'>data</span><span class='rbrace'>}</span><span class='tstring_end'>"</span></span>
|
155
|
+
<span class='kw'>end</span>
|
156
|
+
|
157
|
+
<span class='comment'># Use storage and get notifications.
|
158
|
+
</span><span class='id identifier rubyid_storage'>storage</span><span class='period'>.</span><span class='id identifier rubyid_store'>store</span><span class='lparen'>(</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>my data</span><span class='tstring_end'>"</span></span> <span class='rparen'>)</span>
|
159
|
+
<span class='id identifier rubyid_data'>data</span> <span class='op'>=</span> <span class='id identifier rubyid_storage'>storage</span><span class='period'>.</span><span class='id identifier rubyid_load'>load</span></code></pre>
|
160
|
+
|
161
|
+
|
162
|
+
</div>
|
163
|
+
</div>
|
164
|
+
<div class="tags">
|
165
|
+
|
166
|
+
|
167
|
+
</div><h2>Defined Under Namespace</h2>
|
168
|
+
<p class="children">
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
<strong class="classes">Classes:</strong> <span class='object_link'><a href="NotifyHub/NotFound.html" title="NotifyHub::NotFound (class)">NotFound</a></span>, <span class='object_link'><a href="NotifyHub/Redefining.html" title="NotifyHub::Redefining (class)">Redefining</a></span>
|
174
|
+
|
175
|
+
|
176
|
+
</p>
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
<h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
|
182
|
+
<ul class="summary">
|
183
|
+
|
184
|
+
<li class="public ">
|
185
|
+
<span class="summary_signature">
|
186
|
+
|
187
|
+
<a href="#autodeclare-instance_method" title="#autodeclare (instance method)">- (Object) <strong>autodeclare</strong> </a>
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
</span>
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
|
204
|
+
<span class="summary_desc"><div class='inline'>
|
205
|
+
<p>Declare sets automatically at action registration.</p>
|
206
|
+
</div></span>
|
207
|
+
|
208
|
+
</li>
|
209
|
+
|
210
|
+
|
211
|
+
</ul>
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
<h2>
|
218
|
+
Class Method Summary
|
219
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
220
|
+
</h2>
|
221
|
+
|
222
|
+
<ul class="summary">
|
223
|
+
|
224
|
+
<li class="public ">
|
225
|
+
<span class="summary_signature">
|
226
|
+
|
227
|
+
<a href="#auto-class_method" title="auto (class method)">+ (Object) <strong>auto</strong>(*id) </a>
|
228
|
+
|
229
|
+
|
230
|
+
|
231
|
+
</span>
|
232
|
+
|
233
|
+
|
234
|
+
|
235
|
+
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
|
240
|
+
|
241
|
+
<span class="summary_desc"><div class='inline'>
|
242
|
+
<p>Create NotifyHub and with autodeclare for sets.</p>
|
243
|
+
</div></span>
|
244
|
+
|
245
|
+
</li>
|
246
|
+
|
247
|
+
|
248
|
+
<li class="public ">
|
249
|
+
<span class="summary_signature">
|
250
|
+
|
251
|
+
<a href="#create-class_method" title="create (class method)">+ (Object) <strong>create</strong> { ... }</a>
|
252
|
+
|
253
|
+
|
254
|
+
|
255
|
+
</span>
|
256
|
+
|
257
|
+
|
258
|
+
|
259
|
+
|
260
|
+
|
261
|
+
|
262
|
+
|
263
|
+
|
264
|
+
|
265
|
+
<span class="summary_desc"><div class='inline'>
|
266
|
+
<p>Create NotifyHub and run block with it.</p>
|
267
|
+
</div></span>
|
268
|
+
|
269
|
+
</li>
|
270
|
+
|
271
|
+
|
272
|
+
<li class="public ">
|
273
|
+
<span class="summary_signature">
|
274
|
+
|
275
|
+
<a href="#declare-class_method" title="declare (class method)">+ (Object) <strong>declare</strong>(*id) </a>
|
276
|
+
|
277
|
+
|
278
|
+
|
279
|
+
</span>
|
280
|
+
|
281
|
+
|
282
|
+
|
283
|
+
|
284
|
+
|
285
|
+
|
286
|
+
|
287
|
+
|
288
|
+
|
289
|
+
<span class="summary_desc"><div class='inline'>
|
290
|
+
<p>Create NotifyHub and declare sets.</p>
|
291
|
+
</div></span>
|
292
|
+
|
293
|
+
</li>
|
294
|
+
|
295
|
+
|
296
|
+
</ul>
|
297
|
+
|
298
|
+
<h2>
|
299
|
+
Instance Method Summary
|
300
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
301
|
+
</h2>
|
302
|
+
|
303
|
+
<ul class="summary">
|
304
|
+
|
305
|
+
<li class="public ">
|
306
|
+
<span class="summary_signature">
|
307
|
+
|
308
|
+
<a href="#%5B%5D-instance_method" title="#[] (instance method)">- (NotifySet) <strong>[]</strong>(id) </a>
|
309
|
+
|
310
|
+
|
311
|
+
|
312
|
+
</span>
|
313
|
+
|
314
|
+
|
315
|
+
|
316
|
+
|
317
|
+
|
318
|
+
|
319
|
+
|
320
|
+
|
321
|
+
|
322
|
+
<span class="summary_desc"><div class='inline'>
|
323
|
+
<p>Get NotifySet by ID.</p>
|
324
|
+
</div></span>
|
325
|
+
|
326
|
+
</li>
|
327
|
+
|
328
|
+
|
329
|
+
<li class="public ">
|
330
|
+
<span class="summary_signature">
|
331
|
+
|
332
|
+
<a href="#action-instance_method" title="#action (instance method)">- (Object) <strong>action</strong>(id, &action) </a>
|
333
|
+
|
334
|
+
|
335
|
+
|
336
|
+
(also: #register, #with)
|
337
|
+
|
338
|
+
</span>
|
339
|
+
|
340
|
+
|
341
|
+
|
342
|
+
|
343
|
+
|
344
|
+
|
345
|
+
|
346
|
+
|
347
|
+
|
348
|
+
<span class="summary_desc"><div class='inline'>
|
349
|
+
<p>Register action to NotifySet.</p>
|
350
|
+
</div></span>
|
351
|
+
|
352
|
+
</li>
|
353
|
+
|
354
|
+
|
355
|
+
<li class="public ">
|
356
|
+
<span class="summary_signature">
|
357
|
+
|
358
|
+
<a href="#declare-instance_method" title="#declare (instance method)">- (Object) <strong>declare</strong>(*id) </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>Declare Notify by set.</p>
|
374
|
+
</div></span>
|
375
|
+
|
376
|
+
</li>
|
377
|
+
|
378
|
+
|
379
|
+
<li class="public ">
|
380
|
+
<span class="summary_signature">
|
381
|
+
|
382
|
+
<a href="#enable-instance_method" title="#enable (instance method)">- (Object) <strong>enable</strong>(id, value) </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>Enable/disable Notify set or all if not set.</p>
|
398
|
+
</div></span>
|
399
|
+
|
400
|
+
</li>
|
401
|
+
|
402
|
+
|
403
|
+
<li class="public ">
|
404
|
+
<span class="summary_signature">
|
405
|
+
|
406
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">- (NotifyHub) <strong>initialize</strong>(*id) </a>
|
407
|
+
|
408
|
+
|
409
|
+
|
410
|
+
</span>
|
411
|
+
|
412
|
+
|
413
|
+
<span class="note title constructor">constructor</span>
|
414
|
+
|
415
|
+
|
416
|
+
|
417
|
+
|
418
|
+
|
419
|
+
|
420
|
+
|
421
|
+
|
422
|
+
<span class="summary_desc"><div class='inline'>
|
423
|
+
<p>Instantiation.</p>
|
424
|
+
</div></span>
|
425
|
+
|
426
|
+
</li>
|
427
|
+
|
428
|
+
|
429
|
+
<li class="public ">
|
430
|
+
<span class="summary_signature">
|
431
|
+
|
432
|
+
<a href="#notify-instance_method" title="#notify (instance method)">- (Object) <strong>notify</strong>(id, *args) </a>
|
433
|
+
|
434
|
+
|
435
|
+
|
436
|
+
</span>
|
437
|
+
|
438
|
+
|
439
|
+
|
440
|
+
|
441
|
+
|
442
|
+
|
443
|
+
|
444
|
+
|
445
|
+
|
446
|
+
<span class="summary_desc"><div class='inline'>
|
447
|
+
<p>Run all notifiers in Notify set.</p>
|
448
|
+
</div></span>
|
449
|
+
|
450
|
+
</li>
|
451
|
+
|
452
|
+
|
453
|
+
<li class="public ">
|
454
|
+
<span class="summary_signature">
|
455
|
+
|
456
|
+
<a href="#remove-instance_method" title="#remove (instance method)">- (Object) <strong>remove</strong>(id, notify = nil) </a>
|
457
|
+
|
458
|
+
|
459
|
+
|
460
|
+
</span>
|
461
|
+
|
462
|
+
|
463
|
+
|
464
|
+
|
465
|
+
|
466
|
+
|
467
|
+
|
468
|
+
|
469
|
+
|
470
|
+
<span class="summary_desc"><div class='inline'>
|
471
|
+
<p>Remove all or one Notify.</p>
|
472
|
+
</div></span>
|
473
|
+
|
474
|
+
</li>
|
475
|
+
|
476
|
+
|
477
|
+
</ul>
|
478
|
+
|
479
|
+
|
480
|
+
<div id="constructor_details" class="method_details_list">
|
481
|
+
<h2>Constructor Details</h2>
|
482
|
+
|
483
|
+
<div class="method_details first">
|
484
|
+
<h3 class="signature first" id="initialize-instance_method">
|
485
|
+
|
486
|
+
- (<tt><span class='object_link'><a href="" title="NotifyHub (class)">NotifyHub</a></span></tt>) <strong>initialize</strong>(*id)
|
487
|
+
|
488
|
+
|
489
|
+
|
490
|
+
|
491
|
+
|
492
|
+
</h3><div class="docstring">
|
493
|
+
<div class="discussion">
|
494
|
+
|
495
|
+
<p>Instantiation.</p>
|
496
|
+
|
497
|
+
|
498
|
+
</div>
|
499
|
+
</div>
|
500
|
+
<div class="tags">
|
501
|
+
<p class="tag_title">Parameters:</p>
|
502
|
+
<ul class="param">
|
503
|
+
|
504
|
+
<li>
|
505
|
+
|
506
|
+
<span class='name'>id</span>
|
507
|
+
|
508
|
+
|
509
|
+
<span class='type'>(<tt>Array<Symbol></tt>)</span>
|
510
|
+
|
511
|
+
|
512
|
+
|
513
|
+
—
|
514
|
+
<div class='inline'>
|
515
|
+
<p>Notify set id(s).</p>
|
516
|
+
</div>
|
517
|
+
|
518
|
+
</li>
|
519
|
+
|
520
|
+
</ul>
|
521
|
+
|
522
|
+
|
523
|
+
</div><table class="source_code">
|
524
|
+
<tr>
|
525
|
+
<td>
|
526
|
+
<pre class="lines">
|
527
|
+
|
528
|
+
|
529
|
+
107
|
530
|
+
108
|
531
|
+
109
|
532
|
+
110
|
533
|
+
111</pre>
|
534
|
+
</td>
|
535
|
+
<td>
|
536
|
+
<pre class="code"><span class="info file"># File 'lib/notifyhub.rb', line 107</span>
|
537
|
+
|
538
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span> <span class='op'>*</span><span class='id identifier rubyid_id'>id</span> <span class='rparen'>)</span>
|
539
|
+
<span class='ivar'>@autodeclare</span> <span class='op'>=</span> <span class='kw'>false</span>
|
540
|
+
<span class='ivar'>@set</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
541
|
+
<span class='id identifier rubyid_declare'>declare</span><span class='lparen'>(</span> <span class='op'>*</span><span class='id identifier rubyid_id'>id</span> <span class='rparen'>)</span>
|
542
|
+
<span class='kw'>end</span></pre>
|
543
|
+
</td>
|
544
|
+
</tr>
|
545
|
+
</table>
|
546
|
+
</div>
|
547
|
+
|
548
|
+
</div>
|
549
|
+
|
550
|
+
<div id="instance_attr_details" class="attr_details">
|
551
|
+
<h2>Instance Attribute Details</h2>
|
552
|
+
|
553
|
+
|
554
|
+
<span id="autodeclare=-instance_method"></span>
|
555
|
+
<div class="method_details first">
|
556
|
+
<h3 class="signature first" id="autodeclare-instance_method">
|
557
|
+
|
558
|
+
- (<tt>Object</tt>) <strong>autodeclare</strong>
|
559
|
+
|
560
|
+
|
561
|
+
|
562
|
+
|
563
|
+
|
564
|
+
</h3><div class="docstring">
|
565
|
+
<div class="discussion">
|
566
|
+
|
567
|
+
<p>Declare sets automatically at action registration.</p>
|
568
|
+
|
569
|
+
|
570
|
+
</div>
|
571
|
+
</div>
|
572
|
+
<div class="tags">
|
573
|
+
|
574
|
+
|
575
|
+
</div><table class="source_code">
|
576
|
+
<tr>
|
577
|
+
<td>
|
578
|
+
<pre class="lines">
|
579
|
+
|
580
|
+
|
581
|
+
63
|
582
|
+
64
|
583
|
+
65</pre>
|
584
|
+
</td>
|
585
|
+
<td>
|
586
|
+
<pre class="code"><span class="info file"># File 'lib/notifyhub.rb', line 63</span>
|
587
|
+
|
588
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_autodeclare'>autodeclare</span>
|
589
|
+
<span class='ivar'>@autodeclare</span>
|
590
|
+
<span class='kw'>end</span></pre>
|
591
|
+
</td>
|
592
|
+
</tr>
|
593
|
+
</table>
|
594
|
+
</div>
|
595
|
+
|
596
|
+
</div>
|
597
|
+
|
598
|
+
|
599
|
+
<div id="class_method_details" class="method_details_list">
|
600
|
+
<h2>Class Method Details</h2>
|
601
|
+
|
602
|
+
|
603
|
+
<div class="method_details first">
|
604
|
+
<h3 class="signature first" id="auto-class_method">
|
605
|
+
|
606
|
+
+ (<tt>Object</tt>) <strong>auto</strong>(*id)
|
607
|
+
|
608
|
+
|
609
|
+
|
610
|
+
|
611
|
+
|
612
|
+
</h3><div class="docstring">
|
613
|
+
<div class="discussion">
|
614
|
+
|
615
|
+
<p>Create NotifyHub and with autodeclare for sets. Declare sets automatically
|
616
|
+
at action registration.</p>
|
617
|
+
|
618
|
+
|
619
|
+
</div>
|
620
|
+
</div>
|
621
|
+
<div class="tags">
|
622
|
+
<p class="tag_title">Parameters:</p>
|
623
|
+
<ul class="param">
|
624
|
+
|
625
|
+
<li>
|
626
|
+
|
627
|
+
<span class='name'>id</span>
|
628
|
+
|
629
|
+
|
630
|
+
<span class='type'>(<tt>Array<Symbol></tt>)</span>
|
631
|
+
|
632
|
+
|
633
|
+
|
634
|
+
—
|
635
|
+
<div class='inline'>
|
636
|
+
<p>Notify set(s).</p>
|
637
|
+
</div>
|
638
|
+
|
639
|
+
</li>
|
640
|
+
|
641
|
+
</ul>
|
642
|
+
|
643
|
+
|
644
|
+
</div><table class="source_code">
|
645
|
+
<tr>
|
646
|
+
<td>
|
647
|
+
<pre class="lines">
|
648
|
+
|
649
|
+
|
650
|
+
85
|
651
|
+
86
|
652
|
+
87
|
653
|
+
88
|
654
|
+
89</pre>
|
655
|
+
</td>
|
656
|
+
<td>
|
657
|
+
<pre class="code"><span class="info file"># File 'lib/notifyhub.rb', line 85</span>
|
658
|
+
|
659
|
+
<span class='kw'>def</span> <span class='const'>NotifyHub</span><span class='period'>.</span><span class='id identifier rubyid_auto'>auto</span><span class='lparen'>(</span> <span class='op'>*</span><span class='id identifier rubyid_id'>id</span> <span class='rparen'>)</span>
|
660
|
+
<span class='id identifier rubyid_n'>n</span> <span class='op'>=</span> <span class='const'>NotifyHub</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span> <span class='op'>*</span><span class='id identifier rubyid_id'>id</span> <span class='rparen'>)</span>
|
661
|
+
<span class='id identifier rubyid_n'>n</span><span class='period'>.</span><span class='id identifier rubyid_autodeclare'>autodeclare</span> <span class='op'>=</span> <span class='kw'>true</span>
|
662
|
+
<span class='id identifier rubyid_n'>n</span>
|
663
|
+
<span class='kw'>end</span></pre>
|
664
|
+
</td>
|
665
|
+
</tr>
|
666
|
+
</table>
|
667
|
+
</div>
|
668
|
+
|
669
|
+
<div class="method_details ">
|
670
|
+
<h3 class="signature " id="create-class_method">
|
671
|
+
|
672
|
+
+ (<tt>Object</tt>) <strong>create</strong> { ... }
|
673
|
+
|
674
|
+
|
675
|
+
|
676
|
+
|
677
|
+
|
678
|
+
</h3><div class="docstring">
|
679
|
+
<div class="discussion">
|
680
|
+
|
681
|
+
<p>Create NotifyHub and run block with it.</p>
|
682
|
+
|
683
|
+
|
684
|
+
</div>
|
685
|
+
</div>
|
686
|
+
<div class="tags">
|
687
|
+
|
688
|
+
<p class="tag_title">Yields:</p>
|
689
|
+
<ul class="yield">
|
690
|
+
|
691
|
+
<li>
|
692
|
+
|
693
|
+
|
694
|
+
<span class='type'></span>
|
695
|
+
|
696
|
+
|
697
|
+
|
698
|
+
|
699
|
+
<div class='inline'>
|
700
|
+
<p>Block to run with NotifyHub.</p>
|
701
|
+
</div>
|
702
|
+
|
703
|
+
</li>
|
704
|
+
|
705
|
+
</ul>
|
706
|
+
|
707
|
+
</div><table class="source_code">
|
708
|
+
<tr>
|
709
|
+
<td>
|
710
|
+
<pre class="lines">
|
711
|
+
|
712
|
+
|
713
|
+
95
|
714
|
+
96
|
715
|
+
97
|
716
|
+
98
|
717
|
+
99
|
718
|
+
100
|
719
|
+
101</pre>
|
720
|
+
</td>
|
721
|
+
<td>
|
722
|
+
<pre class="code"><span class="info file"># File 'lib/notifyhub.rb', line 95</span>
|
723
|
+
|
724
|
+
<span class='kw'>def</span> <span class='const'>NotifyHub</span><span class='period'>.</span><span class='id identifier rubyid_create'>create</span><span class='lparen'>(</span> <span class='op'>&</span><span class='id identifier rubyid_blk'>blk</span> <span class='rparen'>)</span>
|
725
|
+
<span class='id identifier rubyid_cg'>cg</span> <span class='op'>=</span> <span class='const'>NotifyHub</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
726
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_block_given?'>block_given?</span>
|
727
|
+
<span class='id identifier rubyid_cg'>cg</span><span class='period'>.</span><span class='id identifier rubyid_instance_eval'>instance_eval</span><span class='lparen'>(</span> <span class='op'>&</span><span class='id identifier rubyid_blk'>blk</span> <span class='rparen'>)</span>
|
728
|
+
<span class='kw'>end</span>
|
729
|
+
<span class='id identifier rubyid_cg'>cg</span>
|
730
|
+
<span class='kw'>end</span></pre>
|
731
|
+
</td>
|
732
|
+
</tr>
|
733
|
+
</table>
|
734
|
+
</div>
|
735
|
+
|
736
|
+
<div class="method_details ">
|
737
|
+
<h3 class="signature " id="declare-class_method">
|
738
|
+
|
739
|
+
+ (<tt>Object</tt>) <strong>declare</strong>(*id)
|
740
|
+
|
741
|
+
|
742
|
+
|
743
|
+
|
744
|
+
|
745
|
+
</h3><div class="docstring">
|
746
|
+
<div class="discussion">
|
747
|
+
|
748
|
+
<p>Create NotifyHub and declare sets.</p>
|
749
|
+
|
750
|
+
|
751
|
+
</div>
|
752
|
+
</div>
|
753
|
+
<div class="tags">
|
754
|
+
<p class="tag_title">Parameters:</p>
|
755
|
+
<ul class="param">
|
756
|
+
|
757
|
+
<li>
|
758
|
+
|
759
|
+
<span class='name'>id</span>
|
760
|
+
|
761
|
+
|
762
|
+
<span class='type'>(<tt>Array<Symbol></tt>)</span>
|
763
|
+
|
764
|
+
|
765
|
+
|
766
|
+
—
|
767
|
+
<div class='inline'>
|
768
|
+
<p>Notify set(s).</p>
|
769
|
+
</div>
|
770
|
+
|
771
|
+
</li>
|
772
|
+
|
773
|
+
</ul>
|
774
|
+
|
775
|
+
|
776
|
+
</div><table class="source_code">
|
777
|
+
<tr>
|
778
|
+
<td>
|
779
|
+
<pre class="lines">
|
780
|
+
|
781
|
+
|
782
|
+
76
|
783
|
+
77
|
784
|
+
78</pre>
|
785
|
+
</td>
|
786
|
+
<td>
|
787
|
+
<pre class="code"><span class="info file"># File 'lib/notifyhub.rb', line 76</span>
|
788
|
+
|
789
|
+
<span class='kw'>def</span> <span class='const'>NotifyHub</span><span class='period'>.</span><span class='id identifier rubyid_declare'>declare</span><span class='lparen'>(</span> <span class='op'>*</span><span class='id identifier rubyid_id'>id</span> <span class='rparen'>)</span>
|
790
|
+
<span class='const'>NotifyHub</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span> <span class='op'>*</span><span class='id identifier rubyid_id'>id</span> <span class='rparen'>)</span>
|
791
|
+
<span class='kw'>end</span></pre>
|
792
|
+
</td>
|
793
|
+
</tr>
|
794
|
+
</table>
|
795
|
+
</div>
|
796
|
+
|
797
|
+
</div>
|
798
|
+
|
799
|
+
<div id="instance_method_details" class="method_details_list">
|
800
|
+
<h2>Instance Method Details</h2>
|
801
|
+
|
802
|
+
|
803
|
+
<div class="method_details first">
|
804
|
+
<h3 class="signature first" id="[]-instance_method">
|
805
|
+
|
806
|
+
- (<tt><span class='object_link'><a href="NotifySet.html" title="NotifySet (class)">NotifySet</a></span></tt>) <strong>[]</strong>(id)
|
807
|
+
|
808
|
+
|
809
|
+
|
810
|
+
|
811
|
+
|
812
|
+
</h3><div class="docstring">
|
813
|
+
<div class="discussion">
|
814
|
+
|
815
|
+
<p>Get NotifySet by ID.</p>
|
816
|
+
|
817
|
+
|
818
|
+
</div>
|
819
|
+
</div>
|
820
|
+
<div class="tags">
|
821
|
+
<p class="tag_title">Parameters:</p>
|
822
|
+
<ul class="param">
|
823
|
+
|
824
|
+
<li>
|
825
|
+
|
826
|
+
<span class='name'>id</span>
|
827
|
+
|
828
|
+
|
829
|
+
<span class='type'>(<tt>Symbol</tt>)</span>
|
830
|
+
|
831
|
+
|
832
|
+
|
833
|
+
—
|
834
|
+
<div class='inline'>
|
835
|
+
<p>Set ID.</p>
|
836
|
+
</div>
|
837
|
+
|
838
|
+
</li>
|
839
|
+
|
840
|
+
</ul>
|
841
|
+
|
842
|
+
<p class="tag_title">Returns:</p>
|
843
|
+
<ul class="return">
|
844
|
+
|
845
|
+
<li>
|
846
|
+
|
847
|
+
|
848
|
+
<span class='type'>(<tt><span class='object_link'><a href="NotifySet.html" title="NotifySet (class)">NotifySet</a></span></tt>)</span>
|
849
|
+
|
850
|
+
|
851
|
+
|
852
|
+
—
|
853
|
+
<div class='inline'>
|
854
|
+
<p>Set.</p>
|
855
|
+
</div>
|
856
|
+
|
857
|
+
</li>
|
858
|
+
|
859
|
+
</ul>
|
860
|
+
|
861
|
+
</div><table class="source_code">
|
862
|
+
<tr>
|
863
|
+
<td>
|
864
|
+
<pre class="lines">
|
865
|
+
|
866
|
+
|
867
|
+
186
|
868
|
+
187
|
869
|
+
188
|
870
|
+
189
|
871
|
+
190</pre>
|
872
|
+
</td>
|
873
|
+
<td>
|
874
|
+
<pre class="code"><span class="info file"># File 'lib/notifyhub.rb', line 186</span>
|
875
|
+
|
876
|
+
<span class='kw'>def</span> <span class='op'>[]</span><span class='lparen'>(</span> <span class='id identifier rubyid_id'>id</span> <span class='rparen'>)</span>
|
877
|
+
<span class='id identifier rubyid_useSet'>useSet</span><span class='lparen'>(</span> <span class='id identifier rubyid_id'>id</span> <span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_set'>set</span><span class='op'>|</span>
|
878
|
+
<span class='id identifier rubyid_set'>set</span>
|
879
|
+
<span class='kw'>end</span>
|
880
|
+
<span class='kw'>end</span></pre>
|
881
|
+
</td>
|
882
|
+
</tr>
|
883
|
+
</table>
|
884
|
+
</div>
|
885
|
+
|
886
|
+
<div class="method_details ">
|
887
|
+
<h3 class="signature " id="action-instance_method">
|
888
|
+
|
889
|
+
- (<tt>Object</tt>) <strong>action</strong>(id, &action)
|
890
|
+
|
891
|
+
|
892
|
+
|
893
|
+
<span class="aliases">Also known as:
|
894
|
+
<span class="names"><span id='register-instance_method'>register</span>, <span id='with-instance_method'>with</span></span>
|
895
|
+
</span>
|
896
|
+
|
897
|
+
|
898
|
+
|
899
|
+
</h3><div class="docstring">
|
900
|
+
<div class="discussion">
|
901
|
+
|
902
|
+
<p>Register action to NotifySet. Multiple notifies can exist per set.</p>
|
903
|
+
|
904
|
+
|
905
|
+
</div>
|
906
|
+
</div>
|
907
|
+
<div class="tags">
|
908
|
+
<p class="tag_title">Parameters:</p>
|
909
|
+
<ul class="param">
|
910
|
+
|
911
|
+
<li>
|
912
|
+
|
913
|
+
<span class='name'>id</span>
|
914
|
+
|
915
|
+
|
916
|
+
<span class='type'>(<tt>Symbol</tt>)</span>
|
917
|
+
|
918
|
+
|
919
|
+
|
920
|
+
—
|
921
|
+
<div class='inline'>
|
922
|
+
<p>Notify set id (class).</p>
|
923
|
+
</div>
|
924
|
+
|
925
|
+
</li>
|
926
|
+
|
927
|
+
<li>
|
928
|
+
|
929
|
+
<span class='name'>action</span>
|
930
|
+
|
931
|
+
|
932
|
+
<span class='type'>(<tt>Block</tt>)</span>
|
933
|
+
|
934
|
+
|
935
|
+
|
936
|
+
—
|
937
|
+
<div class='inline'>
|
938
|
+
<p>Notify action.</p>
|
939
|
+
</div>
|
940
|
+
|
941
|
+
</li>
|
942
|
+
|
943
|
+
</ul>
|
944
|
+
|
945
|
+
|
946
|
+
</div><table class="source_code">
|
947
|
+
<tr>
|
948
|
+
<td>
|
949
|
+
<pre class="lines">
|
950
|
+
|
951
|
+
|
952
|
+
133
|
953
|
+
134
|
954
|
+
135
|
955
|
+
136
|
956
|
+
137</pre>
|
957
|
+
</td>
|
958
|
+
<td>
|
959
|
+
<pre class="code"><span class="info file"># File 'lib/notifyhub.rb', line 133</span>
|
960
|
+
|
961
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_action'>action</span><span class='lparen'>(</span> <span class='id identifier rubyid_id'>id</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_action'>action</span> <span class='rparen'>)</span>
|
962
|
+
<span class='id identifier rubyid_useSet'>useSet</span><span class='lparen'>(</span> <span class='id identifier rubyid_id'>id</span> <span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_set'>set</span><span class='op'>|</span>
|
963
|
+
<span class='id identifier rubyid_set'>set</span><span class='period'>.</span><span class='id identifier rubyid_action'>action</span><span class='lparen'>(</span> <span class='op'>&</span><span class='id identifier rubyid_action'>action</span> <span class='rparen'>)</span>
|
964
|
+
<span class='kw'>end</span>
|
965
|
+
<span class='kw'>end</span></pre>
|
966
|
+
</td>
|
967
|
+
</tr>
|
968
|
+
</table>
|
969
|
+
</div>
|
970
|
+
|
971
|
+
<div class="method_details ">
|
972
|
+
<h3 class="signature " id="declare-instance_method">
|
973
|
+
|
974
|
+
- (<tt>Object</tt>) <strong>declare</strong>(*id)
|
975
|
+
|
976
|
+
|
977
|
+
|
978
|
+
|
979
|
+
|
980
|
+
</h3><div class="docstring">
|
981
|
+
<div class="discussion">
|
982
|
+
|
983
|
+
<p>Declare Notify by set. Multiple notifiers can exist per set.</p>
|
984
|
+
|
985
|
+
|
986
|
+
</div>
|
987
|
+
</div>
|
988
|
+
<div class="tags">
|
989
|
+
<p class="tag_title">Parameters:</p>
|
990
|
+
<ul class="param">
|
991
|
+
|
992
|
+
<li>
|
993
|
+
|
994
|
+
<span class='name'>id</span>
|
995
|
+
|
996
|
+
|
997
|
+
<span class='type'>(<tt>Array<Symbol></tt>)</span>
|
998
|
+
|
999
|
+
|
1000
|
+
|
1001
|
+
—
|
1002
|
+
<div class='inline'>
|
1003
|
+
<p>Notify set id(s).</p>
|
1004
|
+
</div>
|
1005
|
+
|
1006
|
+
</li>
|
1007
|
+
|
1008
|
+
</ul>
|
1009
|
+
|
1010
|
+
|
1011
|
+
</div><table class="source_code">
|
1012
|
+
<tr>
|
1013
|
+
<td>
|
1014
|
+
<pre class="lines">
|
1015
|
+
|
1016
|
+
|
1017
|
+
117
|
1018
|
+
118
|
1019
|
+
119
|
1020
|
+
120
|
1021
|
+
121
|
1022
|
+
122
|
1023
|
+
123
|
1024
|
+
124
|
1025
|
+
125</pre>
|
1026
|
+
</td>
|
1027
|
+
<td>
|
1028
|
+
<pre class="code"><span class="info file"># File 'lib/notifyhub.rb', line 117</span>
|
1029
|
+
|
1030
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_declare'>declare</span><span class='lparen'>(</span> <span class='op'>*</span><span class='id identifier rubyid_id'>id</span> <span class='rparen'>)</span>
|
1031
|
+
<span class='id identifier rubyid_id'>id</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_i'>i</span><span class='op'>|</span>
|
1032
|
+
<span class='kw'>if</span> <span class='ivar'>@set</span><span class='lbracket'>[</span> <span class='id identifier rubyid_i'>i</span> <span class='rbracket'>]</span>
|
1033
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>Redefining</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Notify set already declared: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_i'>i</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='rbrace'>}</span><span class='tstring_end'>"</span></span>
|
1034
|
+
<span class='kw'>else</span>
|
1035
|
+
<span class='ivar'>@set</span><span class='lbracket'>[</span> <span class='id identifier rubyid_i'>i</span> <span class='rbracket'>]</span> <span class='op'>=</span> <span class='const'>NotifySet</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span> <span class='id identifier rubyid_i'>i</span> <span class='rparen'>)</span>
|
1036
|
+
<span class='kw'>end</span>
|
1037
|
+
<span class='kw'>end</span>
|
1038
|
+
<span class='kw'>end</span></pre>
|
1039
|
+
</td>
|
1040
|
+
</tr>
|
1041
|
+
</table>
|
1042
|
+
</div>
|
1043
|
+
|
1044
|
+
<div class="method_details ">
|
1045
|
+
<h3 class="signature " id="enable-instance_method">
|
1046
|
+
|
1047
|
+
- (<tt>Object</tt>) <strong>enable</strong>(id, value)
|
1048
|
+
|
1049
|
+
|
1050
|
+
|
1051
|
+
|
1052
|
+
|
1053
|
+
</h3><div class="docstring">
|
1054
|
+
<div class="discussion">
|
1055
|
+
|
1056
|
+
<p>Enable/disable Notify set or all if not set.</p>
|
1057
|
+
|
1058
|
+
|
1059
|
+
</div>
|
1060
|
+
</div>
|
1061
|
+
<div class="tags">
|
1062
|
+
<p class="tag_title">Parameters:</p>
|
1063
|
+
<ul class="param">
|
1064
|
+
|
1065
|
+
<li>
|
1066
|
+
|
1067
|
+
<span class='name'>id</span>
|
1068
|
+
|
1069
|
+
|
1070
|
+
<span class='type'>(<tt>Symbol</tt>)</span>
|
1071
|
+
|
1072
|
+
|
1073
|
+
|
1074
|
+
—
|
1075
|
+
<div class='inline'>
|
1076
|
+
<p>Notify set id (all if nil given).</p>
|
1077
|
+
</div>
|
1078
|
+
|
1079
|
+
</li>
|
1080
|
+
|
1081
|
+
<li>
|
1082
|
+
|
1083
|
+
<span class='name'>value</span>
|
1084
|
+
|
1085
|
+
|
1086
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
1087
|
+
|
1088
|
+
|
1089
|
+
|
1090
|
+
—
|
1091
|
+
<div class='inline'>
|
1092
|
+
<p>Enable with true and disable with false.</p>
|
1093
|
+
</div>
|
1094
|
+
|
1095
|
+
</li>
|
1096
|
+
|
1097
|
+
</ul>
|
1098
|
+
|
1099
|
+
|
1100
|
+
</div><table class="source_code">
|
1101
|
+
<tr>
|
1102
|
+
<td>
|
1103
|
+
<pre class="lines">
|
1104
|
+
|
1105
|
+
|
1106
|
+
158
|
1107
|
+
159
|
1108
|
+
160
|
1109
|
+
161
|
1110
|
+
162
|
1111
|
+
163
|
1112
|
+
164
|
1113
|
+
165
|
1114
|
+
166
|
1115
|
+
167
|
1116
|
+
168</pre>
|
1117
|
+
</td>
|
1118
|
+
<td>
|
1119
|
+
<pre class="code"><span class="info file"># File 'lib/notifyhub.rb', line 158</span>
|
1120
|
+
|
1121
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_enable'>enable</span><span class='lparen'>(</span> <span class='id identifier rubyid_id'>id</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span> <span class='rparen'>)</span>
|
1122
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_id'>id</span>
|
1123
|
+
<span class='id identifier rubyid_withSet'>withSet</span><span class='lparen'>(</span> <span class='id identifier rubyid_id'>id</span> <span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_set'>set</span><span class='op'>|</span>
|
1124
|
+
<span class='id identifier rubyid_set'>set</span><span class='period'>.</span><span class='id identifier rubyid_enable'>enable</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span>
|
1125
|
+
<span class='kw'>end</span>
|
1126
|
+
<span class='kw'>else</span>
|
1127
|
+
<span class='ivar'>@set</span><span class='period'>.</span><span class='id identifier rubyid_each_value'>each_value</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_set'>set</span><span class='op'>|</span>
|
1128
|
+
<span class='id identifier rubyid_set'>set</span><span class='period'>.</span><span class='id identifier rubyid_enable'>enable</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span>
|
1129
|
+
<span class='kw'>end</span>
|
1130
|
+
<span class='kw'>end</span>
|
1131
|
+
<span class='kw'>end</span></pre>
|
1132
|
+
</td>
|
1133
|
+
</tr>
|
1134
|
+
</table>
|
1135
|
+
</div>
|
1136
|
+
|
1137
|
+
<div class="method_details ">
|
1138
|
+
<h3 class="signature " id="notify-instance_method">
|
1139
|
+
|
1140
|
+
- (<tt>Object</tt>) <strong>notify</strong>(id, *args)
|
1141
|
+
|
1142
|
+
|
1143
|
+
|
1144
|
+
|
1145
|
+
|
1146
|
+
</h3><div class="docstring">
|
1147
|
+
<div class="discussion">
|
1148
|
+
|
1149
|
+
<p>Run all notifiers in Notify set.</p>
|
1150
|
+
|
1151
|
+
|
1152
|
+
</div>
|
1153
|
+
</div>
|
1154
|
+
<div class="tags">
|
1155
|
+
<p class="tag_title">Parameters:</p>
|
1156
|
+
<ul class="param">
|
1157
|
+
|
1158
|
+
<li>
|
1159
|
+
|
1160
|
+
<span class='name'>id</span>
|
1161
|
+
|
1162
|
+
|
1163
|
+
<span class='type'>(<tt>Symbol</tt>)</span>
|
1164
|
+
|
1165
|
+
|
1166
|
+
|
1167
|
+
—
|
1168
|
+
<div class='inline'>
|
1169
|
+
<p>Notify set id (class).</p>
|
1170
|
+
</div>
|
1171
|
+
|
1172
|
+
</li>
|
1173
|
+
|
1174
|
+
<li>
|
1175
|
+
|
1176
|
+
<span class='name'>args</span>
|
1177
|
+
|
1178
|
+
|
1179
|
+
<span class='type'>(<tt>Array<Object></tt>)</span>
|
1180
|
+
|
1181
|
+
|
1182
|
+
|
1183
|
+
—
|
1184
|
+
<div class='inline'>
|
1185
|
+
<p>Arguments for notifiers.</p>
|
1186
|
+
</div>
|
1187
|
+
|
1188
|
+
</li>
|
1189
|
+
|
1190
|
+
</ul>
|
1191
|
+
|
1192
|
+
|
1193
|
+
</div><table class="source_code">
|
1194
|
+
<tr>
|
1195
|
+
<td>
|
1196
|
+
<pre class="lines">
|
1197
|
+
|
1198
|
+
|
1199
|
+
175
|
1200
|
+
176
|
1201
|
+
177
|
1202
|
+
178
|
1203
|
+
179</pre>
|
1204
|
+
</td>
|
1205
|
+
<td>
|
1206
|
+
<pre class="code"><span class="info file"># File 'lib/notifyhub.rb', line 175</span>
|
1207
|
+
|
1208
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_notify'>notify</span><span class='lparen'>(</span> <span class='id identifier rubyid_id'>id</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span> <span class='rparen'>)</span>
|
1209
|
+
<span class='id identifier rubyid_withSet'>withSet</span><span class='lparen'>(</span> <span class='id identifier rubyid_id'>id</span> <span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_set'>set</span><span class='op'>|</span>
|
1210
|
+
<span class='id identifier rubyid_set'>set</span><span class='period'>.</span><span class='id identifier rubyid_notify'>notify</span><span class='lparen'>(</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span> <span class='rparen'>)</span>
|
1211
|
+
<span class='kw'>end</span>
|
1212
|
+
<span class='kw'>end</span></pre>
|
1213
|
+
</td>
|
1214
|
+
</tr>
|
1215
|
+
</table>
|
1216
|
+
</div>
|
1217
|
+
|
1218
|
+
<div class="method_details ">
|
1219
|
+
<h3 class="signature " id="remove-instance_method">
|
1220
|
+
|
1221
|
+
- (<tt>Object</tt>) <strong>remove</strong>(id, notify = nil)
|
1222
|
+
|
1223
|
+
|
1224
|
+
|
1225
|
+
|
1226
|
+
|
1227
|
+
</h3><div class="docstring">
|
1228
|
+
<div class="discussion">
|
1229
|
+
|
1230
|
+
<p>Remove all or one Notify.</p>
|
1231
|
+
|
1232
|
+
|
1233
|
+
</div>
|
1234
|
+
</div>
|
1235
|
+
<div class="tags">
|
1236
|
+
<p class="tag_title">Parameters:</p>
|
1237
|
+
<ul class="param">
|
1238
|
+
|
1239
|
+
<li>
|
1240
|
+
|
1241
|
+
<span class='name'>id</span>
|
1242
|
+
|
1243
|
+
|
1244
|
+
<span class='type'>(<tt>Symbol</tt>)</span>
|
1245
|
+
|
1246
|
+
|
1247
|
+
|
1248
|
+
—
|
1249
|
+
<div class='inline'>
|
1250
|
+
<p>Notify set id (class).</p>
|
1251
|
+
</div>
|
1252
|
+
|
1253
|
+
</li>
|
1254
|
+
|
1255
|
+
<li>
|
1256
|
+
|
1257
|
+
<span class='name'>notify</span>
|
1258
|
+
|
1259
|
+
|
1260
|
+
<span class='type'>(<tt><span class='object_link'><a href="Notify.html" title="Notify (class)">Notify</a></span></tt>)</span>
|
1261
|
+
|
1262
|
+
|
1263
|
+
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
1264
|
+
|
1265
|
+
|
1266
|
+
—
|
1267
|
+
<div class='inline'>
|
1268
|
+
<p>Notify to remove (all if not given).</p>
|
1269
|
+
</div>
|
1270
|
+
|
1271
|
+
</li>
|
1272
|
+
|
1273
|
+
</ul>
|
1274
|
+
|
1275
|
+
|
1276
|
+
</div><table class="source_code">
|
1277
|
+
<tr>
|
1278
|
+
<td>
|
1279
|
+
<pre class="lines">
|
1280
|
+
|
1281
|
+
|
1282
|
+
147
|
1283
|
+
148
|
1284
|
+
149
|
1285
|
+
150
|
1286
|
+
151</pre>
|
1287
|
+
</td>
|
1288
|
+
<td>
|
1289
|
+
<pre class="code"><span class="info file"># File 'lib/notifyhub.rb', line 147</span>
|
1290
|
+
|
1291
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_remove'>remove</span><span class='lparen'>(</span> <span class='id identifier rubyid_id'>id</span><span class='comma'>,</span> <span class='id identifier rubyid_notify'>notify</span> <span class='op'>=</span> <span class='kw'>nil</span> <span class='rparen'>)</span>
|
1292
|
+
<span class='id identifier rubyid_withSet'>withSet</span><span class='lparen'>(</span> <span class='id identifier rubyid_id'>id</span> <span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_set'>set</span><span class='op'>|</span>
|
1293
|
+
<span class='id identifier rubyid_set'>set</span><span class='period'>.</span><span class='id identifier rubyid_remove'>remove</span><span class='lparen'>(</span> <span class='id identifier rubyid_notify'>notify</span> <span class='rparen'>)</span>
|
1294
|
+
<span class='kw'>end</span>
|
1295
|
+
<span class='kw'>end</span></pre>
|
1296
|
+
</td>
|
1297
|
+
</tr>
|
1298
|
+
</table>
|
1299
|
+
</div>
|
1300
|
+
|
1301
|
+
</div>
|
1302
|
+
|
1303
|
+
</div>
|
1304
|
+
|
1305
|
+
<div id="footer">
|
1306
|
+
Generated on Sun Jan 19 21:55:11 2014 by
|
1307
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1308
|
+
0.8.6.1 (ruby-1.9.3).
|
1309
|
+
</div>
|
1310
|
+
|
1311
|
+
</body>
|
1312
|
+
</html>
|