ruff 1.4.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -1
- data/Gemfile +2 -1
- data/Gemfile.lock +16 -12
- data/README.md +35 -58
- data/Rakefile +2 -1
- data/docs/Ruff.html +7 -7
- data/docs/Ruff/Effect.html +165 -23
- data/docs/Ruff/Handler.html +45 -50
- data/docs/Ruff/Standard.html +6 -6
- data/docs/Ruff/Standard/Async.html +26 -26
- data/docs/Ruff/Standard/Async/Instance.html +8 -8
- data/docs/Ruff/Standard/Call1cc.html +6 -6
- data/docs/Ruff/Standard/CurrentTime.html +6 -6
- data/docs/Ruff/Standard/CurrentTime/Instance.html +7 -7
- data/docs/Ruff/Standard/Defer.html +6 -6
- data/docs/Ruff/Standard/Defer/Instance.html +6 -6
- data/docs/Ruff/Standard/MeasureTime.html +6 -6
- data/docs/Ruff/Standard/MeasureTime/Instance.html +8 -8
- data/docs/Ruff/Standard/State.html +6 -6
- data/docs/Ruff/Standard/State/Instance.html +6 -6
- data/docs/Ruff/Throws.html +6 -11
- data/docs/Ruff/Throws/Eff.html +6 -6
- data/docs/Ruff/Throws/Resend.html +6 -6
- data/docs/_index.html +7 -7
- data/docs/class_list.html +2 -2
- data/docs/css/style.css +2 -2
- data/docs/file.README.html +39 -56
- data/docs/file_list.html +2 -2
- data/docs/frames.html +2 -2
- data/docs/index.html +39 -56
- data/docs/js/app.js +14 -3
- data/docs/method_list.html +71 -63
- data/docs/top-level-namespace.html +6 -6
- data/lib/ruff/effect.rb +32 -3
- data/lib/ruff/handler.rb +43 -18
- data/lib/ruff/standard/async.rb +10 -7
- data/lib/ruff/standard/current_time.rb +1 -1
- data/lib/ruff/standard/measure_time.rb +2 -2
- data/lib/ruff/version.rb +1 -1
- data/version +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d9e1dae67b058066cf8391de4fe3ca4f66008b75847ef6a0fcdb9f0c2fc34f83
|
4
|
+
data.tar.gz: 5dd1da59faf5ba97b22b117c8e3ad167daddb753ff9d8056f5ccbe06113c9370
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7871d5559cec31ce9eb44774ba4248f6f74eb7d03882bfc3962dc9a17e3cafc184c3aa5688b85b6612080fb84e59bacfbe227fda22a1245237fc7a7daba6f161
|
7
|
+
data.tar.gz: c483a833deb4ddf6747fffd80e5e29ed987bf1a9347995e37ca5b454d585f4fbb2aebc13905acca15d9dba77341ef68c69719396b179e10fb206aaf11fb8f5b4
|
data/.rubocop.yml
CHANGED
data/Gemfile
CHANGED
@@ -6,7 +6,8 @@ source 'https://rubygems.org'
|
|
6
6
|
gemspec
|
7
7
|
gem 'redcarpet', group: :development
|
8
8
|
gem 'rubocop', group: :development
|
9
|
+
# gem 'irb', group: :development
|
9
10
|
gem 'solargraph', group: :development
|
10
11
|
gem 'yard', group: :development
|
11
12
|
|
12
|
-
gem
|
13
|
+
gem 'irb', '~> 1.0', group: :development
|
data/Gemfile.lock
CHANGED
@@ -1,28 +1,32 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
ruff (
|
4
|
+
ruff (2.0.0)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
9
|
ast (2.4.0)
|
10
10
|
backport (1.1.2)
|
11
|
-
|
12
|
-
irb (1.
|
13
|
-
|
11
|
+
io-console (0.5.4)
|
12
|
+
irb (1.2.1)
|
13
|
+
reline (>= 0.0.1)
|
14
|
+
jaro_winkler (1.5.4)
|
15
|
+
maruku (0.7.3)
|
14
16
|
mini_portile2 (2.4.0)
|
15
|
-
nokogiri (1.10.
|
17
|
+
nokogiri (1.10.7)
|
16
18
|
mini_portile2 (~> 2.4.0)
|
17
|
-
parallel (1.
|
18
|
-
parser (2.
|
19
|
+
parallel (1.19.1)
|
20
|
+
parser (2.7.0.1)
|
19
21
|
ast (~> 2.4.0)
|
20
22
|
rainbow (3.0.0)
|
21
23
|
rake (10.5.0)
|
22
24
|
redcarpet (3.5.0)
|
25
|
+
reline (0.1.2)
|
26
|
+
io-console (~> 0.5)
|
23
27
|
reverse_markdown (1.3.0)
|
24
28
|
nokogiri
|
25
|
-
rubocop (0.
|
29
|
+
rubocop (0.78.0)
|
26
30
|
jaro_winkler (~> 1.5.1)
|
27
31
|
parallel (~> 1.10)
|
28
32
|
parser (>= 2.6)
|
@@ -30,11 +34,11 @@ GEM
|
|
30
34
|
ruby-progressbar (~> 1.7)
|
31
35
|
unicode-display_width (>= 1.4.0, < 1.7)
|
32
36
|
ruby-progressbar (1.10.1)
|
33
|
-
solargraph (0.
|
37
|
+
solargraph (0.38.0)
|
34
38
|
backport (~> 1.1)
|
35
39
|
bundler (>= 1.17.2)
|
36
|
-
htmlentities (~> 4.3, >= 4.3.4)
|
37
40
|
jaro_winkler (~> 1.5)
|
41
|
+
maruku (~> 0.7, >= 0.7.3)
|
38
42
|
nokogiri (~> 1.9, >= 1.9.1)
|
39
43
|
parser (~> 2.3)
|
40
44
|
reverse_markdown (~> 1.0, >= 1.0.5)
|
@@ -45,7 +49,7 @@ GEM
|
|
45
49
|
thor (0.20.3)
|
46
50
|
tilt (2.0.10)
|
47
51
|
unicode-display_width (1.6.0)
|
48
|
-
yard (0.9.
|
52
|
+
yard (0.9.22)
|
49
53
|
|
50
54
|
PLATFORMS
|
51
55
|
ruby
|
@@ -61,4 +65,4 @@ DEPENDENCIES
|
|
61
65
|
yard
|
62
66
|
|
63
67
|
BUNDLED WITH
|
64
|
-
2.
|
68
|
+
2.1.2
|
data/README.md
CHANGED
@@ -3,29 +3,32 @@ ruff
|
|
3
3
|
|
4
4
|
[![Gem Version](https://badge.fury.io/rb/ruff.svg)](https://badge.fury.io/rb/ruff)
|
5
5
|
|
6
|
+
- [source](https://github.com/Nymphium/ruff)
|
7
|
+
- [documentation](https://nymphium.github.io/ruff)
|
8
|
+
|
6
9
|
ONE-SHOT Algebraic Effects Library for Ruby!
|
7
10
|
|
8
11
|
```ruby
|
9
12
|
require "ruff"
|
10
13
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
+
Double = Ruff.instance
|
15
|
+
Triple = Ruff.instance
|
16
|
+
Log = Ruff.instance
|
14
17
|
|
15
18
|
h1 = Ruff.handler
|
16
|
-
.on(
|
17
|
-
.on(
|
19
|
+
.on(Double){|k, v| k[v * 2] }
|
20
|
+
.on(Triple){|k, v| k[v * 3] }
|
18
21
|
|
19
|
-
h2 = Ruff.handler.on(
|
22
|
+
h2 = Ruff.handler.on(Log){|k, msg|
|
20
23
|
k[]
|
21
24
|
puts "logger: #{msg}"
|
22
25
|
}
|
23
26
|
|
24
27
|
h1.run{
|
25
28
|
h2.run{
|
26
|
-
v =
|
27
|
-
|
28
|
-
puts
|
29
|
+
v = Double.perform 2
|
30
|
+
Log.perform (v + 2)
|
31
|
+
puts Triple.perform 3
|
29
32
|
}
|
30
33
|
}
|
31
34
|
# ==> prints
|
@@ -33,55 +36,29 @@ h1.run{
|
|
33
36
|
# logger: 6
|
34
37
|
```
|
35
38
|
|
36
|
-
#
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
s1 = state1.get
|
60
|
-
s2 = state2.get
|
61
|
-
|
62
|
-
Defer.register {
|
63
|
-
puts s1, s2
|
64
|
-
}
|
65
|
-
}
|
66
|
-
}
|
67
|
-
}
|
68
|
-
}
|
69
|
-
|
70
|
-
# ==>
|
71
|
-
# 2019-10-03 03:24:34 +0900
|
72
|
-
# 13
|
73
|
-
# 13!
|
74
|
-
# 12
|
75
|
-
# 12!
|
76
|
-
# 11
|
77
|
-
# 11!
|
78
|
-
```
|
79
|
-
|
80
|
-
- `Ruff::Standard::State`
|
81
|
-
- `Ruff::Standard::Defer`
|
82
|
-
- `Ruff::Standard::CurrentTime`
|
83
|
-
- `Ruff::Standard::MeasureTime`
|
84
|
-
- `Ruff::Standard::Async`
|
39
|
+
# Feature
|
40
|
+
## ***One-shot*** algebraic effects
|
41
|
+
You can access the delimited continuation which can run only once.
|
42
|
+
Even the limitation exists, you can write powerful control flow manipulation, like async/await, call1cc.
|
43
|
+
|
44
|
+
We have an formal definition for the implementation, by showing a conversion from algebraic effects and handlers to asymmetric coroutines.
|
45
|
+
See [here](https://nymphium.github.io/2018/12/09/asymmetric-coroutines%E3%81%AB%E3%82%88%E3%82%8Boneshot-algebraic-effects%E3%81%AE%E5%AE%9F%E8%A3%85.html) (in Japanese).
|
46
|
+
|
47
|
+
## Subtyping on effects
|
48
|
+
You can define an *sub* effect for another effect.
|
49
|
+
It enables to make an effect hierarchy, such as `Exception`s in Java.
|
50
|
+
This implementation is based on a calculus λ<sub>σ<sub><:</sub></sub> [(Description (in Japanese))](https://nymphium.github.io/2019/12/22/effsub.html).
|
51
|
+
|
52
|
+
# Pre-defined effect and handlers
|
53
|
+
We provide some ready-to-use effect and handlers.
|
54
|
+
You can use quickly powerful control flows.
|
55
|
+
|
56
|
+
- [`Ruff::Standard::State`](https://nymphium.github.io/ruff/Ruff/Standard/State.html)
|
57
|
+
- [`Ruff::Standard::Defer`](https://nymphium.github.io/ruff/Ruff/Standard/Defer.html)
|
58
|
+
- [`Ruff::Standard::CurrentTime`](https://nymphium.github.io/ruff/Ruff/Standard/CurrentTime.html)
|
59
|
+
- [`Ruff::Standard::MeasureTime`](https://nymphium.github.io/ruff/Ruff/Standard/MeasureTime.html)
|
60
|
+
- [`Ruff::Standard::Async`](https://nymphium.github.io/ruff/Ruff/Standard/Async.html)
|
61
|
+
- [`Ruff::Standard::Call1cc`](https://nymphium.github.io/ruff/Ruff/Standard/Call1cc.html)
|
85
62
|
|
86
63
|
# LICENSE
|
87
64
|
MIT
|
data/Rakefile
CHANGED
data/docs/Ruff.html
CHANGED
@@ -6,15 +6,15 @@
|
|
6
6
|
<title>
|
7
7
|
Module: Ruff
|
8
8
|
|
9
|
-
— Ruff 1.
|
9
|
+
— Ruff 1.4.0 Documentation
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
13
|
-
<link rel="stylesheet" href="css/style.css" type="text/css"
|
13
|
+
<link rel="stylesheet" href="css/style.css" type="text/css" />
|
14
14
|
|
15
|
-
<link rel="stylesheet" href="css/common.css" type="text/css"
|
15
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" />
|
16
16
|
|
17
|
-
<script type="text/javascript"
|
17
|
+
<script type="text/javascript">
|
18
18
|
pathId = "Ruff";
|
19
19
|
relpath = '';
|
20
20
|
</script>
|
@@ -109,7 +109,7 @@
|
|
109
109
|
<dt id="VERSION-constant" class="">VERSION =
|
110
110
|
|
111
111
|
</dt>
|
112
|
-
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>1.
|
112
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>1.4.0</span><span class='tstring_end'>'</span></span></pre></dd>
|
113
113
|
|
114
114
|
</dl>
|
115
115
|
|
@@ -301,9 +301,9 @@
|
|
301
301
|
</div>
|
302
302
|
|
303
303
|
<div id="footer">
|
304
|
-
Generated on
|
304
|
+
Generated on Thu Jan 2 19:46:22 2020 by
|
305
305
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
306
|
-
0.9.
|
306
|
+
0.9.22 (ruby-2.6.5).
|
307
307
|
</div>
|
308
308
|
|
309
309
|
</div>
|
data/docs/Ruff/Effect.html
CHANGED
@@ -6,15 +6,15 @@
|
|
6
6
|
<title>
|
7
7
|
Class: Ruff::Effect
|
8
8
|
|
9
|
-
— Ruff 1.
|
9
|
+
— Ruff 1.4.0 Documentation
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
13
|
-
<link rel="stylesheet" href="../css/style.css" type="text/css"
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" />
|
14
14
|
|
15
|
-
<link rel="stylesheet" href="../css/common.css" type="text/css"
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" />
|
16
16
|
|
17
|
-
<script type="text/javascript"
|
17
|
+
<script type="text/javascript">
|
18
18
|
pathId = "Ruff::Effect";
|
19
19
|
relpath = '../';
|
20
20
|
</script>
|
@@ -138,7 +138,7 @@
|
|
138
138
|
|
139
139
|
|
140
140
|
|
141
|
-
<span class="summary_desc"><div class='inline'><p>Each instance must be unique so they have unique id with
|
141
|
+
<span class="summary_desc"><div class='inline'><p>Each instance must be unique so they have unique id with an annonymous class instance.</p>
|
142
142
|
</div></span>
|
143
143
|
|
144
144
|
</li>
|
@@ -150,6 +150,38 @@
|
|
150
150
|
|
151
151
|
|
152
152
|
|
153
|
+
<h2>
|
154
|
+
Class Method Summary
|
155
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
156
|
+
</h2>
|
157
|
+
|
158
|
+
<ul class="summary">
|
159
|
+
|
160
|
+
<li class="public ">
|
161
|
+
<span class="summary_signature">
|
162
|
+
|
163
|
+
<a href="#<<-class_method" title="<< (class method)">.<strong><<</strong>(parent) ⇒ Effect<Arg, Ret> </a>
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
</span>
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
<span class="summary_desc"><div class='inline'><p>instanciates an effect, which has an relation <code>self <: parent</code> from the subtyping of <code>id</code> object.</p>
|
178
|
+
</div></span>
|
179
|
+
|
180
|
+
</li>
|
181
|
+
|
182
|
+
|
183
|
+
</ul>
|
184
|
+
|
153
185
|
<h2>
|
154
186
|
Instance Method Summary
|
155
187
|
<small><a href="#" class="summary_toggle">collapse</a></small>
|
@@ -244,17 +276,15 @@
|
|
244
276
|
<pre class="lines">
|
245
277
|
|
246
278
|
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
15</pre>
|
279
|
+
15
|
280
|
+
16
|
281
|
+
17</pre>
|
251
282
|
</td>
|
252
283
|
<td>
|
253
|
-
<pre class="code"><span class="info file"># File 'lib/ruff/effect.rb', line
|
284
|
+
<pre class="code"><span class="info file"># File 'lib/ruff/effect.rb', line 15</span>
|
254
285
|
|
255
286
|
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span>
|
256
|
-
<span class='ivar'>@id</span> <span class='op'>=</span> <span class='const'>
|
257
|
-
<span class='ivar'>@id</span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span>
|
287
|
+
<span class='ivar'>@id</span> <span class='op'>=</span> <span class='const'>Class</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
258
288
|
<span class='kw'>end</span></pre>
|
259
289
|
</td>
|
260
290
|
</tr>
|
@@ -279,7 +309,9 @@
|
|
279
309
|
|
280
310
|
</h3><div class="docstring">
|
281
311
|
<div class="discussion">
|
282
|
-
<p>Each instance must be unique so they have unique id with
|
312
|
+
<p>Each instance must be unique so they have unique id with an annonymous class instance.</p>
|
313
|
+
|
314
|
+
<p>The class instance may have subtyping relation.</p>
|
283
315
|
|
284
316
|
|
285
317
|
</div>
|
@@ -287,18 +319,25 @@
|
|
287
319
|
<div class="tags">
|
288
320
|
|
289
321
|
|
322
|
+
<p class="tag_title">See Also:</p>
|
323
|
+
<ul class="see">
|
324
|
+
|
325
|
+
<li><span class='object_link'><a href="#<<-class_method" title="Ruff::Effect.<< (method)"><<</a></span></li>
|
326
|
+
|
327
|
+
</ul>
|
328
|
+
|
290
329
|
</div><table class="source_code">
|
291
330
|
<tr>
|
292
331
|
<td>
|
293
332
|
<pre class="lines">
|
294
333
|
|
295
334
|
|
296
|
-
|
297
|
-
|
298
|
-
|
335
|
+
9
|
336
|
+
10
|
337
|
+
11</pre>
|
299
338
|
</td>
|
300
339
|
<td>
|
301
|
-
<pre class="code"><span class="info file"># File 'lib/ruff/effect.rb', line
|
340
|
+
<pre class="code"><span class="info file"># File 'lib/ruff/effect.rb', line 9</span>
|
302
341
|
|
303
342
|
<span class='kw'>def</span> <span class='id identifier rubyid_id'>id</span>
|
304
343
|
<span class='ivar'>@id</span>
|
@@ -311,6 +350,109 @@
|
|
311
350
|
</div>
|
312
351
|
|
313
352
|
|
353
|
+
<div id="class_method_details" class="method_details_list">
|
354
|
+
<h2>Class Method Details</h2>
|
355
|
+
|
356
|
+
|
357
|
+
<div class="method_details first">
|
358
|
+
<h3 class="signature first" id="<<-class_method">
|
359
|
+
|
360
|
+
.<strong><<</strong>(parent) ⇒ <tt><span class='object_link'><a href="" title="Ruff::Effect (class)">Effect</a></span><Arg, Ret></tt>
|
361
|
+
|
362
|
+
|
363
|
+
|
364
|
+
|
365
|
+
|
366
|
+
</h3><div class="docstring">
|
367
|
+
<div class="discussion">
|
368
|
+
<p>instanciates an effect, which has an relation <code>self <: parent</code>
|
369
|
+
from the subtyping of <code>id</code> object.</p>
|
370
|
+
|
371
|
+
|
372
|
+
</div>
|
373
|
+
</div>
|
374
|
+
<div class="tags">
|
375
|
+
|
376
|
+
<div class="examples">
|
377
|
+
<p class="tag_title">Examples:</p>
|
378
|
+
|
379
|
+
|
380
|
+
<pre class="example code"><code><span class='const'>Exception</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../Ruff.html" title="Ruff (module)">Ruff</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="Ruff::Effect (class)">Effect</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="#initialize-instance_method" title="Ruff::Effect#initialize (method)">new</a></span></span>
|
381
|
+
<span class='const'>RuntimeException</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../Ruff.html" title="Ruff (module)">Ruff</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="Ruff::Effect (class)">Effect</a></span></span> <span class='op'><<</span> <span class='const'>Exception</span>
|
382
|
+
|
383
|
+
<span class='const'><span class='object_link'><a href="../Ruff.html" title="Ruff (module)">Ruff</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Handler.html" title="Ruff::Handler (class)">Handler</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Handler.html#initialize-instance_method" title="Ruff::Handler#initialize (method)">new</a></span></span>
|
384
|
+
<span class='period'>.</span><span class='id identifier rubyid_on'>on</span><span class='lparen'>(</span><span class='const'>Exception</span><span class='rparen'>)</span><span class='lbrace'>{</span>
|
385
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>catch</span><span class='tstring_end'>"</span></span>
|
386
|
+
<span class='rbrace'>}</span>
|
387
|
+
<span class='period'>.</span><span class='id identifier rubyid_run'>run</span> <span class='lbrace'>{</span>
|
388
|
+
<span class='const'>RuntimeException</span><span class='period'>.</span><span class='id identifier rubyid_perform'>perform</span>
|
389
|
+
<span class='rbrace'>}</span>
|
390
|
+
<span class='comment'># ==> prints "catch"</span></code></pre>
|
391
|
+
|
392
|
+
</div>
|
393
|
+
<p class="tag_title">Parameters:</p>
|
394
|
+
<ul class="param">
|
395
|
+
|
396
|
+
<li>
|
397
|
+
|
398
|
+
<span class='name'>parent</span>
|
399
|
+
|
400
|
+
|
401
|
+
<span class='type'>(<tt><span class='object_link'><a href="" title="Ruff::Effect (class)">Effect</a></span><Arg, Ret></tt>)</span>
|
402
|
+
|
403
|
+
|
404
|
+
|
405
|
+
</li>
|
406
|
+
|
407
|
+
</ul>
|
408
|
+
|
409
|
+
<p class="tag_title">Returns:</p>
|
410
|
+
<ul class="return">
|
411
|
+
|
412
|
+
<li>
|
413
|
+
|
414
|
+
|
415
|
+
<span class='type'>(<tt><span class='object_link'><a href="" title="Ruff::Effect (class)">Effect</a></span><Arg, Ret></tt>)</span>
|
416
|
+
|
417
|
+
|
418
|
+
|
419
|
+
—
|
420
|
+
<div class='inline'><p>with an relation <code>it <: parent</code></p>
|
421
|
+
</div>
|
422
|
+
|
423
|
+
</li>
|
424
|
+
|
425
|
+
</ul>
|
426
|
+
|
427
|
+
</div><table class="source_code">
|
428
|
+
<tr>
|
429
|
+
<td>
|
430
|
+
<pre class="lines">
|
431
|
+
|
432
|
+
|
433
|
+
37
|
434
|
+
38
|
435
|
+
39
|
436
|
+
40
|
437
|
+
41
|
438
|
+
42</pre>
|
439
|
+
</td>
|
440
|
+
<td>
|
441
|
+
<pre class="code"><span class="info file"># File 'lib/ruff/effect.rb', line 37</span>
|
442
|
+
|
443
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='op'><<</span><span class='lparen'>(</span><span class='id identifier rubyid_parent'>parent</span><span class='rparen'>)</span>
|
444
|
+
<span class='id identifier rubyid_inst'>inst</span> <span class='op'>=</span> <span class='id identifier rubyid_new'>new</span>
|
445
|
+
<span class='id identifier rubyid_parent_id'>parent_id</span> <span class='op'>=</span> <span class='id identifier rubyid_parent'>parent</span><span class='period'>.</span><span class='id identifier rubyid_instance_variable_get'>instance_variable_get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>@id</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
446
|
+
<span class='id identifier rubyid_inst'>inst</span><span class='period'>.</span><span class='id identifier rubyid_instance_variable_set'>instance_variable_set</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>@id</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='lparen'>(</span><span class='const'>Class</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='id identifier rubyid_parent_id'>parent_id</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='rparen'>)</span>
|
447
|
+
<span class='id identifier rubyid_inst'>inst</span>
|
448
|
+
<span class='kw'>end</span></pre>
|
449
|
+
</td>
|
450
|
+
</tr>
|
451
|
+
</table>
|
452
|
+
</div>
|
453
|
+
|
454
|
+
</div>
|
455
|
+
|
314
456
|
<div id="instance_method_details" class="method_details_list">
|
315
457
|
<h2>Instance Method Details</h2>
|
316
458
|
|
@@ -384,12 +526,12 @@
|
|
384
526
|
<pre class="lines">
|
385
527
|
|
386
528
|
|
387
|
-
|
388
|
-
|
389
|
-
|
529
|
+
51
|
530
|
+
52
|
531
|
+
53</pre>
|
390
532
|
</td>
|
391
533
|
<td>
|
392
|
-
<pre class="code"><span class="info file"># File 'lib/ruff/effect.rb', line
|
534
|
+
<pre class="code"><span class="info file"># File 'lib/ruff/effect.rb', line 51</span>
|
393
535
|
|
394
536
|
<span class='kw'>def</span> <span class='id identifier rubyid_perform'>perform</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_a'>a</span><span class='rparen'>)</span>
|
395
537
|
<span class='const'>Fiber</span><span class='period'>.</span><span class='id identifier rubyid_yield'>yield</span> <span class='const'><span class='object_link'><a href="../Ruff.html" title="Ruff (module)">Ruff</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Throws.html" title="Ruff::Throws (module)">Throws</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Throws/Eff.html" title="Ruff::Throws::Eff (class)">Eff</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Throws/Eff.html#initialize-instance_method" title="Ruff::Throws::Eff#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='ivar'>@id</span><span class='comma'>,</span> <span class='id identifier rubyid_a'>a</span><span class='rparen'>)</span>
|
@@ -404,9 +546,9 @@
|
|
404
546
|
</div>
|
405
547
|
|
406
548
|
<div id="footer">
|
407
|
-
Generated on
|
549
|
+
Generated on Thu Jan 2 19:46:23 2020 by
|
408
550
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
409
|
-
0.9.
|
551
|
+
0.9.22 (ruby-2.6.5).
|
410
552
|
</div>
|
411
553
|
|
412
554
|
</div>
|