mangrove 0.4.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,889 @@
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: Mangrove::Result
8
+
9
+ &mdash; Documentation by YARD 0.9.34
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../css/style.css" type="text/css" />
14
+
15
+ <link rel="stylesheet" href="../css/common.css" type="text/css" />
16
+
17
+ <script type="text/javascript">
18
+ pathId = "Mangrove::Result";
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 (R)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../Mangrove.html" title="Mangrove (module)">Mangrove</a></span></span>
41
+ &raquo;
42
+ <span class="title">Result</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: Mangrove::Result
63
+ <span class="abstract note title">Abstract</span>
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+
70
+
71
+
72
+ <dl>
73
+ <dt>Extended by:</dt>
74
+ <dd>T::Generic, T::Helpers, T::Sig</dd>
75
+ </dl>
76
+
77
+
78
+
79
+ <dl>
80
+ <dt>Includes:</dt>
81
+ <dd>Kernel</dd>
82
+ </dl>
83
+
84
+
85
+
86
+
87
+ <dl>
88
+ <dt>Included in:</dt>
89
+ <dd><span class='object_link'><a href="Result/Err.html" title="Mangrove::Result::Err (class)">Err</a></span>, <span class='object_link'><a href="Result/Ok.html" title="Mangrove::Result::Ok (class)">Ok</a></span></dd>
90
+ </dl>
91
+
92
+
93
+
94
+ <dl>
95
+ <dt>Defined in:</dt>
96
+ <dd>lib/mangrove/result.rb<span class="defines">,<br />
97
+ lib/mangrove/result/control_signal.rb</span>
98
+ </dd>
99
+ </dl>
100
+
101
+ </div>
102
+
103
+ <h2>Overview</h2><div class="docstring">
104
+ <div class="discussion">
105
+ <div class="note abstract">
106
+ <strong>This module is abstract.</strong>
107
+ <div class='inline'>
108
+ <p>Subclasses must implement the ‘abstract` methods below.</p>
109
+ </div>
110
+ </div>
111
+
112
+ <p>Result is a type that represents either success (‘Ok`) or failure (`Err`).</p>
113
+
114
+
115
+ </div>
116
+ </div>
117
+ <div class="tags">
118
+
119
+
120
+ </div><h2>Defined Under Namespace</h2>
121
+ <p class="children">
122
+
123
+
124
+
125
+
126
+ <strong class="classes">Classes:</strong> <span class='object_link'><a href="Result/ControlSignal.html" title="Mangrove::Result::ControlSignal (class)">ControlSignal</a></span>, <span class='object_link'><a href="Result/Err.html" title="Mangrove::Result::Err (class)">Err</a></span>, <span class='object_link'><a href="Result/Ok.html" title="Mangrove::Result::Ok (class)">Ok</a></span>
127
+
128
+
129
+ </p>
130
+
131
+
132
+ <h2>
133
+ Constant Summary
134
+ <small><a href="#" class="constants_summary_toggle">collapse</a></small>
135
+ </h2>
136
+
137
+ <dl class="constants">
138
+
139
+ <dt id="OkType-constant" class="">OkType =
140
+
141
+ </dt>
142
+ <dd><pre class="code"><span class='id identifier rubyid_type_member'>type_member</span></pre></dd>
143
+
144
+ <dt id="ErrType-constant" class="">ErrType =
145
+
146
+ </dt>
147
+ <dd><pre class="code"><span class='id identifier rubyid_type_member'>type_member</span></pre></dd>
148
+
149
+ </dl>
150
+
151
+
152
+
153
+
154
+
155
+
156
+
157
+
158
+
159
+ <h2>
160
+ Class Method Summary
161
+ <small><a href="#" class="summary_toggle">collapse</a></small>
162
+ </h2>
163
+
164
+ <ul class="summary">
165
+
166
+ <li class="public ">
167
+ <span class="summary_signature">
168
+
169
+ <a href="#from_results-class_method" title="from_results (class method)">.<strong>from_results</strong>(results) &#x21d2; Result[OkType, ErrType] </a>
170
+
171
+
172
+
173
+ </span>
174
+
175
+
176
+
177
+
178
+
179
+
180
+
181
+
182
+
183
+ <span class="summary_desc"><div class='inline'></div></span>
184
+
185
+ </li>
186
+
187
+
188
+ </ul>
189
+
190
+ <h2>
191
+ Instance Method Summary
192
+ <small><a href="#" class="summary_toggle">collapse</a></small>
193
+ </h2>
194
+
195
+ <ul class="summary">
196
+
197
+ <li class="public ">
198
+ <span class="summary_signature">
199
+
200
+ <a href="#==-instance_method" title="#== (instance method)">#<strong>==</strong>(other) &#x21d2; Boolean </a>
201
+
202
+
203
+
204
+ </span>
205
+
206
+
207
+
208
+
209
+ <span class="abstract note title">abstract</span>
210
+
211
+
212
+
213
+
214
+ <span class="summary_desc"><div class='inline'></div></span>
215
+
216
+ </li>
217
+
218
+
219
+ <li class="public ">
220
+ <span class="summary_signature">
221
+
222
+ <a href="#err%3F-instance_method" title="#err? (instance method)">#<strong>err?</strong> &#x21d2; Boolean </a>
223
+
224
+
225
+
226
+ </span>
227
+
228
+
229
+
230
+
231
+ <span class="abstract note title">abstract</span>
232
+
233
+
234
+
235
+
236
+ <span class="summary_desc"><div class='inline'></div></span>
237
+
238
+ </li>
239
+
240
+
241
+ <li class="public ">
242
+ <span class="summary_signature">
243
+
244
+ <a href="#expect!-instance_method" title="#expect! (instance method)">#<strong>expect!</strong>(message) &#x21d2; OkType </a>
245
+
246
+
247
+
248
+ </span>
249
+
250
+
251
+
252
+
253
+ <span class="abstract note title">abstract</span>
254
+
255
+
256
+
257
+
258
+ <span class="summary_desc"><div class='inline'></div></span>
259
+
260
+ </li>
261
+
262
+
263
+ <li class="public ">
264
+ <span class="summary_signature">
265
+
266
+ <a href="#map_err-instance_method" title="#map_err (instance method)">#<strong>map_err</strong>(&amp;block) &#x21d2; Result[OkType, ErrType] </a>
267
+
268
+
269
+
270
+ </span>
271
+
272
+
273
+
274
+
275
+ <span class="abstract note title">abstract</span>
276
+
277
+
278
+
279
+
280
+ <span class="summary_desc"><div class='inline'></div></span>
281
+
282
+ </li>
283
+
284
+
285
+ <li class="public ">
286
+ <span class="summary_signature">
287
+
288
+ <a href="#map_ok-instance_method" title="#map_ok (instance method)">#<strong>map_ok</strong>(&amp;block) &#x21d2; Result[OkType, ErrType] </a>
289
+
290
+
291
+
292
+ </span>
293
+
294
+
295
+
296
+
297
+ <span class="abstract note title">abstract</span>
298
+
299
+
300
+
301
+
302
+ <span class="summary_desc"><div class='inline'></div></span>
303
+
304
+ </li>
305
+
306
+
307
+ <li class="public ">
308
+ <span class="summary_signature">
309
+
310
+ <a href="#ok%3F-instance_method" title="#ok? (instance method)">#<strong>ok?</strong> &#x21d2; Boolean </a>
311
+
312
+
313
+
314
+ </span>
315
+
316
+
317
+
318
+
319
+ <span class="abstract note title">abstract</span>
320
+
321
+
322
+
323
+
324
+ <span class="summary_desc"><div class='inline'></div></span>
325
+
326
+ </li>
327
+
328
+
329
+ <li class="public ">
330
+ <span class="summary_signature">
331
+
332
+ <a href="#unwrap!-instance_method" title="#unwrap! (instance method)">#<strong>unwrap!</strong> &#x21d2; OkType </a>
333
+
334
+
335
+
336
+ </span>
337
+
338
+
339
+
340
+
341
+ <span class="abstract note title">abstract</span>
342
+
343
+
344
+
345
+
346
+ <span class="summary_desc"><div class='inline'></div></span>
347
+
348
+ </li>
349
+
350
+
351
+ </ul>
352
+
353
+
354
+
355
+
356
+
357
+
358
+
359
+
360
+ <div id="class_method_details" class="method_details_list">
361
+ <h2>Class Method Details</h2>
362
+
363
+
364
+ <div class="method_details first">
365
+ <h3 class="signature first" id="from_results-class_method">
366
+
367
+ .<strong>from_results</strong>(results) &#x21d2; <tt><span class='object_link'><a href="" title="Mangrove::Result (module)">Result</a></span>[<span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::OkType (constant)">OkType</a></span>, <span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::ErrType (constant)">ErrType</a></span>]</tt>
368
+
369
+
370
+
371
+
372
+
373
+ </h3><div class="docstring">
374
+ <div class="discussion">
375
+
376
+
377
+ </div>
378
+ </div>
379
+ <div class="tags">
380
+ <p class="tag_title">Parameters:</p>
381
+ <ul class="param">
382
+
383
+ <li>
384
+
385
+ <span class='name'>results</span>
386
+
387
+
388
+ <span class='type'>(<tt>Enumerable&lt;<span class='object_link'><a href="" title="Mangrove::Result (module)">Mangrove::Result</a></span>[<span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::OkType (constant)">OkType</a></span>, <span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::ErrType (constant)">ErrType</a></span>]&gt;</tt>)</span>
389
+
390
+
391
+
392
+ </li>
393
+
394
+ </ul>
395
+
396
+ <p class="tag_title">Returns:</p>
397
+ <ul class="return">
398
+
399
+ <li>
400
+
401
+
402
+ <span class='type'>(<tt><span class='object_link'><a href="" title="Mangrove::Result (module)">Result</a></span>[<span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::OkType (constant)">OkType</a></span>, <span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::ErrType (constant)">ErrType</a></span>]</tt>)</span>
403
+
404
+
405
+
406
+ </li>
407
+
408
+ </ul>
409
+
410
+ </div><table class="source_code">
411
+ <tr>
412
+ <td>
413
+ <pre class="lines">
414
+
415
+
416
+ 50
417
+ 51
418
+ 52
419
+ 53
420
+ 54
421
+ 55
422
+ 56
423
+ 57
424
+ 58
425
+ 59
426
+ 60</pre>
427
+ </td>
428
+ <td>
429
+ <pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 50</span>
430
+
431
+ <span class='kw'>def</span> <span class='id identifier rubyid_from_results'>from_results</span><span class='lparen'>(</span><span class='id identifier rubyid_results'>results</span><span class='rparen'>)</span>
432
+ <span class='id identifier rubyid_errs'>errs</span> <span class='op'>=</span> <span class='id identifier rubyid_results'>results</span><span class='period'>.</span><span class='id identifier rubyid_filter'>filter</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='symbol'>:err?</span><span class='rparen'>)</span>
433
+
434
+ <span class='kw'>if</span> <span class='id identifier rubyid_errs'>errs</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
435
+ <span class='comment'># This is safe as errs is empty.
436
+ </span> <span class='const'><span class='object_link'><a href="" title="Mangrove::Result (module)">Result</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Result/Ok.html" title="Mangrove::Result::Ok (class)">Ok</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Result/Ok.html#initialize-instance_method" title="Mangrove::Result::Ok#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_results'>results</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_r'>r</span><span class='op'>|</span> <span class='const'>T</span><span class='period'>.</span><span class='id identifier rubyid_cast'>cast</span><span class='lparen'>(</span><span class='id identifier rubyid_r'>r</span><span class='comma'>,</span> <span class='const'><span class='object_link'><a href="" title="Mangrove::Result (module)">Result</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Result/Ok.html" title="Mangrove::Result::Ok (class)">Ok</a></span></span><span class='lbracket'>[</span><span class='const'><span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::OkType (constant)">OkType</a></span></span><span class='comma'>,</span> <span class='const'><span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::ErrType (constant)">ErrType</a></span></span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_ok_inner'>ok_inner</span> <span class='rbrace'>}</span><span class='rparen'>)</span>
437
+ <span class='kw'>else</span>
438
+ <span class='comment'># This is safe as errs is results where err? is true
439
+ </span> <span class='const'><span class='object_link'><a href="" title="Mangrove::Result (module)">Result</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Result/Err.html" title="Mangrove::Result::Err (class)">Err</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Result/Err.html#initialize-instance_method" title="Mangrove::Result::Err#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_errs'>errs</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_r'>r</span><span class='op'>|</span> <span class='const'>T</span><span class='period'>.</span><span class='id identifier rubyid_cast'>cast</span><span class='lparen'>(</span><span class='id identifier rubyid_r'>r</span><span class='comma'>,</span> <span class='const'><span class='object_link'><a href="" title="Mangrove::Result (module)">Result</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Result/Err.html" title="Mangrove::Result::Err (class)">Err</a></span></span><span class='lbracket'>[</span><span class='const'><span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::OkType (constant)">OkType</a></span></span><span class='comma'>,</span> <span class='const'><span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::ErrType (constant)">ErrType</a></span></span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_err_inner'>err_inner</span> <span class='rbrace'>}</span><span class='rparen'>)</span>
440
+ <span class='kw'>end</span>
441
+ <span class='kw'>end</span></pre>
442
+ </td>
443
+ </tr>
444
+ </table>
445
+ </div>
446
+
447
+ </div>
448
+
449
+ <div id="instance_method_details" class="method_details_list">
450
+ <h2>Instance Method Details</h2>
451
+
452
+
453
+ <div class="method_details first">
454
+ <h3 class="signature first" id="==-instance_method">
455
+
456
+ #<strong>==</strong>(other) &#x21d2; <tt>Boolean</tt>
457
+
458
+
459
+
460
+
461
+
462
+ </h3><div class="docstring">
463
+ <div class="discussion">
464
+ <div class="note abstract">
465
+ <strong>This method is abstract.</strong>
466
+ <div class='inline'></div>
467
+ </div>
468
+
469
+
470
+ </div>
471
+ </div>
472
+ <div class="tags">
473
+ <p class="tag_title">Parameters:</p>
474
+ <ul class="param">
475
+
476
+ <li>
477
+
478
+ <span class='name'>other</span>
479
+
480
+
481
+ <span class='type'>(<tt>BasicObject</tt>)</span>
482
+
483
+
484
+
485
+ </li>
486
+
487
+ </ul>
488
+
489
+ <p class="tag_title">Returns:</p>
490
+ <ul class="return">
491
+
492
+ <li>
493
+
494
+
495
+ <span class='type'>(<tt>Boolean</tt>)</span>
496
+
497
+
498
+
499
+ </li>
500
+
501
+ </ul>
502
+
503
+ </div><table class="source_code">
504
+ <tr>
505
+ <td>
506
+ <pre class="lines">
507
+
508
+
509
+ 22</pre>
510
+ </td>
511
+ <td>
512
+ <pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 22</span>
513
+
514
+ <span class='kw'>def</span> <span class='op'>==</span><span class='lparen'>(</span><span class='id identifier rubyid_other'>other</span><span class='rparen'>)</span><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
515
+ </td>
516
+ </tr>
517
+ </table>
518
+ </div>
519
+
520
+ <div class="method_details ">
521
+ <h3 class="signature " id="err?-instance_method">
522
+
523
+ #<strong>err?</strong> &#x21d2; <tt>Boolean</tt>
524
+
525
+
526
+
527
+
528
+
529
+ </h3><div class="docstring">
530
+ <div class="discussion">
531
+ <div class="note abstract">
532
+ <strong>This method is abstract.</strong>
533
+ <div class='inline'></div>
534
+ </div>
535
+
536
+
537
+ </div>
538
+ </div>
539
+ <div class="tags">
540
+
541
+ <p class="tag_title">Returns:</p>
542
+ <ul class="return">
543
+
544
+ <li>
545
+
546
+
547
+ <span class='type'>(<tt>Boolean</tt>)</span>
548
+
549
+
550
+
551
+ </li>
552
+
553
+ </ul>
554
+
555
+ </div><table class="source_code">
556
+ <tr>
557
+ <td>
558
+ <pre class="lines">
559
+
560
+
561
+ 28</pre>
562
+ </td>
563
+ <td>
564
+ <pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 28</span>
565
+
566
+ <span class='kw'>def</span> <span class='id identifier rubyid_err?'>err?</span><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
567
+ </td>
568
+ </tr>
569
+ </table>
570
+ </div>
571
+
572
+ <div class="method_details ">
573
+ <h3 class="signature " id="expect!-instance_method">
574
+
575
+ #<strong>expect!</strong>(message) &#x21d2; <tt><span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::OkType (constant)">OkType</a></span></tt>
576
+
577
+
578
+
579
+
580
+
581
+ </h3><div class="docstring">
582
+ <div class="discussion">
583
+ <div class="note abstract">
584
+ <strong>This method is abstract.</strong>
585
+ <div class='inline'></div>
586
+ </div>
587
+
588
+
589
+ </div>
590
+ </div>
591
+ <div class="tags">
592
+ <p class="tag_title">Parameters:</p>
593
+ <ul class="param">
594
+
595
+ <li>
596
+
597
+ <span class='name'>message</span>
598
+
599
+
600
+ <span class='type'>(<tt>String</tt>)</span>
601
+
602
+
603
+
604
+ </li>
605
+
606
+ </ul>
607
+
608
+ <p class="tag_title">Returns:</p>
609
+ <ul class="return">
610
+
611
+ <li>
612
+
613
+
614
+ <span class='type'>(<tt><span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::OkType (constant)">OkType</a></span></tt>)</span>
615
+
616
+
617
+
618
+ </li>
619
+
620
+ </ul>
621
+
622
+ </div><table class="source_code">
623
+ <tr>
624
+ <td>
625
+ <pre class="lines">
626
+
627
+
628
+ 34</pre>
629
+ </td>
630
+ <td>
631
+ <pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 34</span>
632
+
633
+ <span class='kw'>def</span> <span class='id identifier rubyid_expect!'>expect!</span><span class='lparen'>(</span><span class='id identifier rubyid_message'>message</span><span class='rparen'>)</span><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
634
+ </td>
635
+ </tr>
636
+ </table>
637
+ </div>
638
+
639
+ <div class="method_details ">
640
+ <h3 class="signature " id="map_err-instance_method">
641
+
642
+ #<strong>map_err</strong>(&amp;block) &#x21d2; <tt><span class='object_link'><a href="" title="Mangrove::Result (module)">Result</a></span>[<span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::OkType (constant)">OkType</a></span>, <span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::ErrType (constant)">ErrType</a></span>]</tt>
643
+
644
+
645
+
646
+
647
+
648
+ </h3><div class="docstring">
649
+ <div class="discussion">
650
+ <div class="note abstract">
651
+ <strong>This method is abstract.</strong>
652
+ <div class='inline'></div>
653
+ </div>
654
+
655
+
656
+ </div>
657
+ </div>
658
+ <div class="tags">
659
+ <p class="tag_title">Parameters:</p>
660
+ <ul class="param">
661
+
662
+ <li>
663
+
664
+ <span class='name'>block</span>
665
+
666
+
667
+ <span class='type'>(<tt>T.proc.params(this: <span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::ErrType (constant)">ErrType</a></span>).returns(<span class='object_link'><a href="" title="Mangrove::Result (module)">Result</a></span>[<span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::OkType (constant)">OkType</a></span>, <span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::ErrType (constant)">ErrType</a></span>])</tt>)</span>
668
+
669
+
670
+
671
+ </li>
672
+
673
+ </ul>
674
+
675
+ <p class="tag_title">Returns:</p>
676
+ <ul class="return">
677
+
678
+ <li>
679
+
680
+
681
+ <span class='type'>(<tt><span class='object_link'><a href="" title="Mangrove::Result (module)">Result</a></span>[<span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::OkType (constant)">OkType</a></span>, <span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::ErrType (constant)">ErrType</a></span>]</tt>)</span>
682
+
683
+
684
+
685
+ </li>
686
+
687
+ </ul>
688
+
689
+ </div><table class="source_code">
690
+ <tr>
691
+ <td>
692
+ <pre class="lines">
693
+
694
+
695
+ 40</pre>
696
+ </td>
697
+ <td>
698
+ <pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 40</span>
699
+
700
+ <span class='kw'>def</span> <span class='id identifier rubyid_map_err'>map_err</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
701
+ </td>
702
+ </tr>
703
+ </table>
704
+ </div>
705
+
706
+ <div class="method_details ">
707
+ <h3 class="signature " id="map_ok-instance_method">
708
+
709
+ #<strong>map_ok</strong>(&amp;block) &#x21d2; <tt><span class='object_link'><a href="" title="Mangrove::Result (module)">Result</a></span>[<span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::OkType (constant)">OkType</a></span>, <span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::ErrType (constant)">ErrType</a></span>]</tt>
710
+
711
+
712
+
713
+
714
+
715
+ </h3><div class="docstring">
716
+ <div class="discussion">
717
+ <div class="note abstract">
718
+ <strong>This method is abstract.</strong>
719
+ <div class='inline'></div>
720
+ </div>
721
+
722
+
723
+ </div>
724
+ </div>
725
+ <div class="tags">
726
+ <p class="tag_title">Parameters:</p>
727
+ <ul class="param">
728
+
729
+ <li>
730
+
731
+ <span class='name'>block</span>
732
+
733
+
734
+ <span class='type'>(<tt>T.proc.params(this: <span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::OkType (constant)">OkType</a></span>).returns(<span class='object_link'><a href="" title="Mangrove::Result (module)">Result</a></span>[<span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::OkType (constant)">OkType</a></span>, <span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::ErrType (constant)">ErrType</a></span>])</tt>)</span>
735
+
736
+
737
+
738
+ </li>
739
+
740
+ </ul>
741
+
742
+ <p class="tag_title">Returns:</p>
743
+ <ul class="return">
744
+
745
+ <li>
746
+
747
+
748
+ <span class='type'>(<tt><span class='object_link'><a href="" title="Mangrove::Result (module)">Result</a></span>[<span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::OkType (constant)">OkType</a></span>, <span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::ErrType (constant)">ErrType</a></span>]</tt>)</span>
749
+
750
+
751
+
752
+ </li>
753
+
754
+ </ul>
755
+
756
+ </div><table class="source_code">
757
+ <tr>
758
+ <td>
759
+ <pre class="lines">
760
+
761
+
762
+ 37</pre>
763
+ </td>
764
+ <td>
765
+ <pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 37</span>
766
+
767
+ <span class='kw'>def</span> <span class='id identifier rubyid_map_ok'>map_ok</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
768
+ </td>
769
+ </tr>
770
+ </table>
771
+ </div>
772
+
773
+ <div class="method_details ">
774
+ <h3 class="signature " id="ok?-instance_method">
775
+
776
+ #<strong>ok?</strong> &#x21d2; <tt>Boolean</tt>
777
+
778
+
779
+
780
+
781
+
782
+ </h3><div class="docstring">
783
+ <div class="discussion">
784
+ <div class="note abstract">
785
+ <strong>This method is abstract.</strong>
786
+ <div class='inline'></div>
787
+ </div>
788
+
789
+
790
+ </div>
791
+ </div>
792
+ <div class="tags">
793
+
794
+ <p class="tag_title">Returns:</p>
795
+ <ul class="return">
796
+
797
+ <li>
798
+
799
+
800
+ <span class='type'>(<tt>Boolean</tt>)</span>
801
+
802
+
803
+
804
+ </li>
805
+
806
+ </ul>
807
+
808
+ </div><table class="source_code">
809
+ <tr>
810
+ <td>
811
+ <pre class="lines">
812
+
813
+
814
+ 25</pre>
815
+ </td>
816
+ <td>
817
+ <pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 25</span>
818
+
819
+ <span class='kw'>def</span> <span class='id identifier rubyid_ok?'>ok?</span><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
820
+ </td>
821
+ </tr>
822
+ </table>
823
+ </div>
824
+
825
+ <div class="method_details ">
826
+ <h3 class="signature " id="unwrap!-instance_method">
827
+
828
+ #<strong>unwrap!</strong> &#x21d2; <tt><span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::OkType (constant)">OkType</a></span></tt>
829
+
830
+
831
+
832
+
833
+
834
+ </h3><div class="docstring">
835
+ <div class="discussion">
836
+ <div class="note abstract">
837
+ <strong>This method is abstract.</strong>
838
+ <div class='inline'></div>
839
+ </div>
840
+
841
+
842
+ </div>
843
+ </div>
844
+ <div class="tags">
845
+
846
+ <p class="tag_title">Returns:</p>
847
+ <ul class="return">
848
+
849
+ <li>
850
+
851
+
852
+ <span class='type'>(<tt><span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::OkType (constant)">OkType</a></span></tt>)</span>
853
+
854
+
855
+
856
+ </li>
857
+
858
+ </ul>
859
+
860
+ </div><table class="source_code">
861
+ <tr>
862
+ <td>
863
+ <pre class="lines">
864
+
865
+
866
+ 31</pre>
867
+ </td>
868
+ <td>
869
+ <pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 31</span>
870
+
871
+ <span class='kw'>def</span> <span class='id identifier rubyid_unwrap!'>unwrap!</span><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
872
+ </td>
873
+ </tr>
874
+ </table>
875
+ </div>
876
+
877
+ </div>
878
+
879
+ </div>
880
+
881
+ <div id="footer">
882
+ Generated on Fri Sep 1 17:32:57 2023 by
883
+ <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
884
+ 0.9.34 (ruby-3.2.2).
885
+ </div>
886
+
887
+ </div>
888
+ </body>
889
+ </html>