mangrove 0.9.2 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/docs/Mangrove/ControlFlow/ControlSignal.html +1 -1
- data/docs/Mangrove/ControlFlow.html +1 -1
- data/docs/Mangrove/Option/ControlSignal.html +1 -1
- data/docs/Mangrove/Option/None.html +85 -80
- data/docs/Mangrove/Option/Some.html +93 -88
- data/docs/Mangrove/Option.html +166 -52
- data/docs/Mangrove/Result/ControlSignal.html +1 -1
- data/docs/Mangrove/Result/Err.html +1 -1
- data/docs/Mangrove/Result/Ok.html +1 -1
- data/docs/Mangrove/Result.html +1 -1
- data/docs/Mangrove.html +2 -2
- data/docs/_index.html +1 -1
- data/docs/file.README.html +1 -1
- data/docs/index.html +1 -1
- data/docs/method_list.html +69 -61
- data/docs/top-level-namespace.html +1 -1
- data/lib/mangrove/option.rb +28 -14
- data/lib/mangrove/version.rb +1 -1
- metadata +1 -1
@@ -244,7 +244,7 @@
|
|
244
244
|
<li class="public ">
|
245
245
|
<span class="summary_signature">
|
246
246
|
|
247
|
-
<a href="#
|
247
|
+
<a href="#map-instance_method" title="#map (instance method)">#<strong>map</strong>(&block) ⇒ ::Mangrove::Option[T.type_parameter(:NewInnerType)] </a>
|
248
248
|
|
249
249
|
|
250
250
|
|
@@ -266,7 +266,7 @@
|
|
266
266
|
<li class="public ">
|
267
267
|
<span class="summary_signature">
|
268
268
|
|
269
|
-
<a href="#
|
269
|
+
<a href="#none%3F-instance_method" title="#none? (instance method)">#<strong>none?</strong> ⇒ Boolean </a>
|
270
270
|
|
271
271
|
|
272
272
|
|
@@ -288,7 +288,7 @@
|
|
288
288
|
<li class="public ">
|
289
289
|
<span class="summary_signature">
|
290
290
|
|
291
|
-
<a href="#
|
291
|
+
<a href="#or-instance_method" title="#or (instance method)">#<strong>or</strong>(_default) ⇒ Option[InnerType] </a>
|
292
292
|
|
293
293
|
|
294
294
|
|
@@ -432,6 +432,11 @@
|
|
432
432
|
|
433
433
|
|
434
434
|
|
435
|
+
<h3 class="inherited">Methods included from <span class='object_link'><a href="../Option.html" title="Mangrove::Option (module)">Mangrove::Option</a></span></h3>
|
436
|
+
<p class="inherited"><span class='object_link'><a href="../Option.html#from_nilable-class_method" title="Mangrove::Option.from_nilable (method)">from_nilable</a></span></p>
|
437
|
+
|
438
|
+
|
439
|
+
|
435
440
|
|
436
441
|
<div id="constructor_details" class="method_details_list">
|
437
442
|
<h2>Constructor Details</h2>
|
@@ -475,12 +480,12 @@
|
|
475
480
|
<pre class="lines">
|
476
481
|
|
477
482
|
|
478
|
-
|
479
|
-
|
480
|
-
|
483
|
+
46
|
484
|
+
47
|
485
|
+
48</pre>
|
481
486
|
</td>
|
482
487
|
<td>
|
483
|
-
<pre class="code"><span class="info file"># File 'lib/mangrove/option.rb', line
|
488
|
+
<pre class="code"><span class="info file"># File 'lib/mangrove/option.rb', line 46</span>
|
484
489
|
|
485
490
|
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_inner'>inner</span><span class='rparen'>)</span>
|
486
491
|
<span class='ivar'>@inner</span> <span class='op'>=</span> <span class='const'>T</span><span class='period'>.</span><span class='id identifier rubyid_let'>let</span><span class='lparen'>(</span><span class='id identifier rubyid_inner'>inner</span><span class='comma'>,</span> <span class='const'><span class='object_link'><a href="#InnerType-constant" title="Mangrove::Option::Some::InnerType (constant)">InnerType</a></span></span><span class='rparen'>)</span>
|
@@ -549,20 +554,20 @@
|
|
549
554
|
<pre class="lines">
|
550
555
|
|
551
556
|
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
557
|
+
51
|
558
|
+
52
|
559
|
+
53
|
560
|
+
54
|
561
|
+
55
|
562
|
+
56
|
563
|
+
57
|
564
|
+
58
|
565
|
+
59
|
566
|
+
60
|
567
|
+
61</pre>
|
563
568
|
</td>
|
564
569
|
<td>
|
565
|
-
<pre class="code"><span class="info file"># File 'lib/mangrove/option.rb', line
|
570
|
+
<pre class="code"><span class="info file"># File 'lib/mangrove/option.rb', line 51</span>
|
566
571
|
|
567
572
|
<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>
|
568
573
|
<span class='kw'>case</span> <span class='id identifier rubyid_other'>other</span>
|
@@ -632,12 +637,12 @@
|
|
632
637
|
<pre class="lines">
|
633
638
|
|
634
639
|
|
635
|
-
|
636
|
-
|
637
|
-
|
640
|
+
79
|
641
|
+
80
|
642
|
+
81</pre>
|
638
643
|
</td>
|
639
644
|
<td>
|
640
|
-
<pre class="code"><span class="info file"># File 'lib/mangrove/option.rb', line
|
645
|
+
<pre class="code"><span class="info file"># File 'lib/mangrove/option.rb', line 79</span>
|
641
646
|
|
642
647
|
<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>
|
643
648
|
<span class='ivar'>@inner</span>
|
@@ -699,12 +704,12 @@
|
|
699
704
|
<pre class="lines">
|
700
705
|
|
701
706
|
|
702
|
-
|
703
|
-
|
704
|
-
|
707
|
+
84
|
708
|
+
85
|
709
|
+
86</pre>
|
705
710
|
</td>
|
706
711
|
<td>
|
707
|
-
<pre class="code"><span class="info file"># File 'lib/mangrove/option.rb', line
|
712
|
+
<pre class="code"><span class="info file"># File 'lib/mangrove/option.rb', line 84</span>
|
708
713
|
|
709
714
|
<span class='kw'>def</span> <span class='id identifier rubyid_expect_with!'>expect_with!</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid__block'>_block</span><span class='rparen'>)</span>
|
710
715
|
<span class='ivar'>@inner</span>
|
@@ -715,9 +720,9 @@
|
|
715
720
|
</div>
|
716
721
|
|
717
722
|
<div class="method_details ">
|
718
|
-
<h3 class="signature " id="
|
723
|
+
<h3 class="signature " id="map-instance_method">
|
719
724
|
|
720
|
-
#<strong>
|
725
|
+
#<strong>map</strong>(&block) ⇒ <tt><span class='object_link'><a href="../Option.html" title="Mangrove::Option (module)">::Mangrove::Option</a></span>[T.type_parameter(:NewInnerType)]</tt>
|
721
726
|
|
722
727
|
|
723
728
|
|
@@ -735,10 +740,10 @@
|
|
735
740
|
|
736
741
|
<li>
|
737
742
|
|
738
|
-
<span class='name'>
|
743
|
+
<span class='name'>block</span>
|
739
744
|
|
740
745
|
|
741
|
-
<span class='type'>(<tt>T.proc.
|
746
|
+
<span class='type'>(<tt>T.proc.params(inner: <span class='object_link'><a href="#InnerType-constant" title="Mangrove::Option::Some::InnerType (constant)">InnerType</a></span>).returns(<span class='object_link'><a href="../Option.html" title="Mangrove::Option (module)">Option</a></span>[T.type_parameter(:NewInnerType)])</tt>)</span>
|
742
747
|
|
743
748
|
|
744
749
|
|
@@ -752,7 +757,7 @@
|
|
752
757
|
<li>
|
753
758
|
|
754
759
|
|
755
|
-
<span class='type'>(<tt><span class='object_link'><a href="" title="Mangrove::Option
|
760
|
+
<span class='type'>(<tt><span class='object_link'><a href="../Option.html" title="Mangrove::Option (module)">::Mangrove::Option</a></span>[T.type_parameter(:NewInnerType)]</tt>)</span>
|
756
761
|
|
757
762
|
|
758
763
|
|
@@ -766,15 +771,15 @@
|
|
766
771
|
<pre class="lines">
|
767
772
|
|
768
773
|
|
769
|
-
|
770
|
-
|
771
|
-
|
774
|
+
95
|
775
|
+
96
|
776
|
+
97</pre>
|
772
777
|
</td>
|
773
778
|
<td>
|
774
|
-
<pre class="code"><span class="info file"># File 'lib/mangrove/option.rb', line
|
779
|
+
<pre class="code"><span class="info file"># File 'lib/mangrove/option.rb', line 95</span>
|
775
780
|
|
776
|
-
<span class='kw'>def</span> <span class='id identifier
|
777
|
-
<span class='
|
781
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_map'>map</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
782
|
+
<span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='ivar'>@inner</span><span class='rparen'>)</span>
|
778
783
|
<span class='kw'>end</span></pre>
|
779
784
|
</td>
|
780
785
|
</tr>
|
@@ -782,9 +787,9 @@
|
|
782
787
|
</div>
|
783
788
|
|
784
789
|
<div class="method_details ">
|
785
|
-
<h3 class="signature " id="
|
790
|
+
<h3 class="signature " id="none?-instance_method">
|
786
791
|
|
787
|
-
#<strong>
|
792
|
+
#<strong>none?</strong> ⇒ <tt>Boolean</tt>
|
788
793
|
|
789
794
|
|
790
795
|
|
@@ -797,29 +802,14 @@
|
|
797
802
|
</div>
|
798
803
|
</div>
|
799
804
|
<div class="tags">
|
800
|
-
<p class="tag_title">Parameters:</p>
|
801
|
-
<ul class="param">
|
802
|
-
|
803
|
-
<li>
|
804
|
-
|
805
|
-
<span class='name'>block</span>
|
806
|
-
|
807
|
-
|
808
|
-
<span class='type'>(<tt>T.proc.params(inner: <span class='object_link'><a href="#InnerType-constant" title="Mangrove::Option::Some::InnerType (constant)">InnerType</a></span>).returns(<span class='object_link'><a href="../Option.html" title="Mangrove::Option (module)">Option</a></span>[<span class='object_link'><a href="#InnerType-constant" title="Mangrove::Option::Some::InnerType (constant)">InnerType</a></span>])</tt>)</span>
|
809
|
-
|
810
|
-
|
811
|
-
|
812
|
-
</li>
|
813
805
|
|
814
|
-
</ul>
|
815
|
-
|
816
806
|
<p class="tag_title">Returns:</p>
|
817
807
|
<ul class="return">
|
818
808
|
|
819
809
|
<li>
|
820
810
|
|
821
811
|
|
822
|
-
<span class='type'>(<tt
|
812
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
823
813
|
|
824
814
|
|
825
815
|
|
@@ -833,25 +823,21 @@
|
|
833
823
|
<pre class="lines">
|
834
824
|
|
835
825
|
|
836
|
-
|
837
|
-
82
|
838
|
-
83</pre>
|
826
|
+
92</pre>
|
839
827
|
</td>
|
840
828
|
<td>
|
841
|
-
<pre class="code"><span class="info file"># File 'lib/mangrove/option.rb', line
|
829
|
+
<pre class="code"><span class="info file"># File 'lib/mangrove/option.rb', line 92</span>
|
842
830
|
|
843
|
-
<span class='kw'>def</span> <span class='id identifier
|
844
|
-
<span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='ivar'>@inner</span><span class='rparen'>)</span>
|
845
|
-
<span class='kw'>end</span></pre>
|
831
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_none?'>none?</span> <span class='op'>=</span> <span class='kw'>false</span></pre>
|
846
832
|
</td>
|
847
833
|
</tr>
|
848
834
|
</table>
|
849
835
|
</div>
|
850
836
|
|
851
837
|
<div class="method_details ">
|
852
|
-
<h3 class="signature " id="
|
838
|
+
<h3 class="signature " id="or-instance_method">
|
853
839
|
|
854
|
-
#<strong>
|
840
|
+
#<strong>or</strong>(_default) ⇒ <tt><span class='object_link'><a href="../Option.html" title="Mangrove::Option (module)">Option</a></span>[<span class='object_link'><a href="#InnerType-constant" title="Mangrove::Option::Some::InnerType (constant)">InnerType</a></span>]</tt>
|
855
841
|
|
856
842
|
|
857
843
|
|
@@ -864,14 +850,29 @@
|
|
864
850
|
</div>
|
865
851
|
</div>
|
866
852
|
<div class="tags">
|
853
|
+
<p class="tag_title">Parameters:</p>
|
854
|
+
<ul class="param">
|
867
855
|
|
856
|
+
<li>
|
857
|
+
|
858
|
+
<span class='name'>_default</span>
|
859
|
+
|
860
|
+
|
861
|
+
<span class='type'>(<tt><span class='object_link'><a href="../Option.html" title="Mangrove::Option (module)">Option</a></span>[<span class='object_link'><a href="#InnerType-constant" title="Mangrove::Option::Some::InnerType (constant)">InnerType</a></span>]</tt>)</span>
|
862
|
+
|
863
|
+
|
864
|
+
|
865
|
+
</li>
|
866
|
+
|
867
|
+
</ul>
|
868
|
+
|
868
869
|
<p class="tag_title">Returns:</p>
|
869
870
|
<ul class="return">
|
870
871
|
|
871
872
|
<li>
|
872
873
|
|
873
874
|
|
874
|
-
<span class='type'>(<tt>
|
875
|
+
<span class='type'>(<tt><span class='object_link'><a href="../Option.html" title="Mangrove::Option (module)">Option</a></span>[<span class='object_link'><a href="#InnerType-constant" title="Mangrove::Option::Some::InnerType (constant)">InnerType</a></span>]</tt>)</span>
|
875
876
|
|
876
877
|
|
877
878
|
|
@@ -885,12 +886,16 @@
|
|
885
886
|
<pre class="lines">
|
886
887
|
|
887
888
|
|
888
|
-
|
889
|
+
100
|
890
|
+
101
|
891
|
+
102</pre>
|
889
892
|
</td>
|
890
893
|
<td>
|
891
|
-
<pre class="code"><span class="info file"># File 'lib/mangrove/option.rb', line
|
894
|
+
<pre class="code"><span class="info file"># File 'lib/mangrove/option.rb', line 100</span>
|
892
895
|
|
893
|
-
<span class='kw'>def</span> <span class='
|
896
|
+
<span class='kw'>def</span> <span class='kw'>or</span><span class='lparen'>(</span><span class='id identifier rubyid__default'>_default</span><span class='rparen'>)</span>
|
897
|
+
<span class='kw'>self</span>
|
898
|
+
<span class='kw'>end</span></pre>
|
894
899
|
</td>
|
895
900
|
</tr>
|
896
901
|
</table>
|
@@ -933,10 +938,10 @@
|
|
933
938
|
<pre class="lines">
|
934
939
|
|
935
940
|
|
936
|
-
|
941
|
+
89</pre>
|
937
942
|
</td>
|
938
943
|
<td>
|
939
|
-
<pre class="code"><span class="info file"># File 'lib/mangrove/option.rb', line
|
944
|
+
<pre class="code"><span class="info file"># File 'lib/mangrove/option.rb', line 89</span>
|
940
945
|
|
941
946
|
<span class='kw'>def</span> <span class='id identifier rubyid_some?'>some?</span> <span class='op'>=</span> <span class='kw'>true</span></pre>
|
942
947
|
</td>
|
@@ -996,12 +1001,12 @@
|
|
996
1001
|
<pre class="lines">
|
997
1002
|
|
998
1003
|
|
999
|
-
|
1000
|
-
|
1001
|
-
|
1004
|
+
105
|
1005
|
+
106
|
1006
|
+
107</pre>
|
1002
1007
|
</td>
|
1003
1008
|
<td>
|
1004
|
-
<pre class="code"><span class="info file"># File 'lib/mangrove/option.rb', line
|
1009
|
+
<pre class="code"><span class="info file"># File 'lib/mangrove/option.rb', line 105</span>
|
1005
1010
|
|
1006
1011
|
<span class='kw'>def</span> <span class='id identifier rubyid_transpose'>transpose</span><span class='lparen'>(</span><span class='id identifier rubyid__err'>_err</span><span class='rparen'>)</span>
|
1007
1012
|
<span class='const'><span class='object_link'><a href="../Result.html" 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='ivar'>@inner</span><span class='rparen'>)</span>
|
@@ -1048,12 +1053,12 @@
|
|
1048
1053
|
<pre class="lines">
|
1049
1054
|
|
1050
1055
|
|
1051
|
-
|
1052
|
-
|
1053
|
-
|
1056
|
+
64
|
1057
|
+
65
|
1058
|
+
66</pre>
|
1054
1059
|
</td>
|
1055
1060
|
<td>
|
1056
|
-
<pre class="code"><span class="info file"># File 'lib/mangrove/option.rb', line
|
1061
|
+
<pre class="code"><span class="info file"># File 'lib/mangrove/option.rb', line 64</span>
|
1057
1062
|
|
1058
1063
|
<span class='kw'>def</span> <span class='id identifier rubyid_unwrap'>unwrap</span>
|
1059
1064
|
<span class='ivar'>@inner</span>
|
@@ -1100,12 +1105,12 @@
|
|
1100
1105
|
<pre class="lines">
|
1101
1106
|
|
1102
1107
|
|
1103
|
-
|
1104
|
-
|
1105
|
-
|
1108
|
+
74
|
1109
|
+
75
|
1110
|
+
76</pre>
|
1106
1111
|
</td>
|
1107
1112
|
<td>
|
1108
|
-
<pre class="code"><span class="info file"># File 'lib/mangrove/option.rb', line
|
1113
|
+
<pre class="code"><span class="info file"># File 'lib/mangrove/option.rb', line 74</span>
|
1109
1114
|
|
1110
1115
|
<span class='kw'>def</span> <span class='id identifier rubyid_unwrap!'>unwrap!</span>
|
1111
1116
|
<span class='ivar'>@inner</span>
|
@@ -1167,12 +1172,12 @@
|
|
1167
1172
|
<pre class="lines">
|
1168
1173
|
|
1169
1174
|
|
1170
|
-
|
1171
|
-
|
1172
|
-
|
1175
|
+
69
|
1176
|
+
70
|
1177
|
+
71</pre>
|
1173
1178
|
</td>
|
1174
1179
|
<td>
|
1175
|
-
<pre class="code"><span class="info file"># File 'lib/mangrove/option.rb', line
|
1180
|
+
<pre class="code"><span class="info file"># File 'lib/mangrove/option.rb', line 69</span>
|
1176
1181
|
|
1177
1182
|
<span class='kw'>def</span> <span class='id identifier rubyid_unwrap_or'>unwrap_or</span><span class='lparen'>(</span><span class='id identifier rubyid__default'>_default</span><span class='rparen'>)</span>
|
1178
1183
|
<span class='ivar'>@inner</span>
|
@@ -1187,7 +1192,7 @@
|
|
1187
1192
|
</div>
|
1188
1193
|
|
1189
1194
|
<div id="footer">
|
1190
|
-
Generated on Tue Oct 24
|
1195
|
+
Generated on Tue Oct 24 20:35:18 2023 by
|
1191
1196
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1192
1197
|
0.9.34 (ruby-3.1.2).
|
1193
1198
|
</div>
|