mangrove 0.20.0 → 0.21.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mangrove/result.rb +13 -0
- data/lib/mangrove/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 761b124e30c530cd26a779e7e789633a3e84ed545f639e6655dcfd637b132da0
|
4
|
+
data.tar.gz: 2b65549240b5f94a9d52714620c8664d734cf2a065e5e165e666b45ed56064c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ae0b59477a9855dce2947f97556b871a111f631bc931d07cfa6f1be9630532d73c4bd3e7c4d883ac5bc75a52cfdd588eb5e83c63f8be0bbece59c1ad8c35b27
|
7
|
+
data.tar.gz: fd0ace87a61d26da101a4b1ae13521c67922e0aed43f1c658c570b991e5e5226fa4fac87f8b3d92045322bc82ceb60340013d1fd61180c796dfff7c0a8f98ba9
|
data/lib/mangrove/result.rb
CHANGED
@@ -30,6 +30,9 @@ module Mangrove
|
|
30
30
|
sig { abstract.returns(OkType) }
|
31
31
|
def unwrap!; end
|
32
32
|
|
33
|
+
sig { abstract.params(block: T.proc.params(err: ErrType).returns(Exception)).returns(OkType) }
|
34
|
+
def unwrap_or_raise_with!(&block); end
|
35
|
+
|
33
36
|
sig { abstract.params(exception: Exception).returns(OkType) }
|
34
37
|
def unwrap_or_raise!(exception); end
|
35
38
|
|
@@ -186,6 +189,11 @@ module Mangrove
|
|
186
189
|
@inner
|
187
190
|
end
|
188
191
|
|
192
|
+
sig { override.params(block: T.proc.params(err: ErrType).returns(Exception)).returns(OkType) }
|
193
|
+
def unwrap_or_raise_with!(&block)
|
194
|
+
@inner
|
195
|
+
end
|
196
|
+
|
189
197
|
sig { override.returns(OkType) }
|
190
198
|
def unwrap_or_raise_inner!
|
191
199
|
@inner
|
@@ -350,6 +358,11 @@ module Mangrove
|
|
350
358
|
raise exception
|
351
359
|
end
|
352
360
|
|
361
|
+
sig { override.params(block: T.proc.params(err: ErrType).returns(Exception)).returns(OkType) }
|
362
|
+
def unwrap_or_raise_with!(&block)
|
363
|
+
raise block.call(@inner)
|
364
|
+
end
|
365
|
+
|
353
366
|
sig { override.returns(OkType) }
|
354
367
|
def unwrap_or_raise_inner!
|
355
368
|
raise T.unsafe(@inner)
|
data/lib/mangrove/version.rb
CHANGED