use_cases 3.0.1 → 3.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/use_cases/module_optins/validated.rb +1 -0
- data/lib/use_cases/result.rb +12 -2
- data/lib/use_cases/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 85052ba74b76415cee8c9450c1705bc4b23d695f74625bd20ecb72a034bc34c5
|
4
|
+
data.tar.gz: 4bcae2e34010a1e321e366066c79add5565a6805a38962e6a1478aa032f5869c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 158ffaaf8361d65b2747a7cc7f7349f84aefcb36a86b4fda5b45435bbb998e042b8d48bc4f305d52bcaca7072245bfce01e9befc1a47820e85920939059a917c
|
7
|
+
data.tar.gz: 6ed08ac0933e1e39d3249eaf637079e5c72d790770953a9d29aa2d3dd186474041a8119a1e2949ffa23537828dd3575001d06e163c303257dac5b35ecde25322
|
data/Gemfile.lock
CHANGED
data/lib/use_cases/result.rb
CHANGED
@@ -10,9 +10,19 @@ module UseCases
|
|
10
10
|
@result = result
|
11
11
|
end
|
12
12
|
|
13
|
+
def method_missing(method, *args, &block)
|
14
|
+
return result.send(method, *args, &block) if result.respond_to?(method)
|
15
|
+
|
16
|
+
super
|
17
|
+
end
|
18
|
+
|
19
|
+
def respond_to_missing?(method, include_private = false)
|
20
|
+
result.respond_to?(method, include_private) || super
|
21
|
+
end
|
22
|
+
|
13
23
|
def value
|
14
24
|
return result if result_not_monad?
|
15
|
-
return
|
25
|
+
return if result_empty?
|
16
26
|
|
17
27
|
result.success? ? result.value! : result.failure
|
18
28
|
end
|
@@ -39,7 +49,7 @@ module UseCases
|
|
39
49
|
end
|
40
50
|
|
41
51
|
def to_result
|
42
|
-
|
52
|
+
result
|
43
53
|
end
|
44
54
|
|
45
55
|
def result_empty?
|
data/lib/use_cases/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: use_cases
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ring Twice
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-01-
|
11
|
+
date: 2023-01-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|