clean-architecture 6.0.0 → 6.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/clean_architecture/matchers/use_case_result.rb +2 -17
- data/lib/clean_architecture/serializers/html_response_from_result.rb +1 -1
- data/lib/clean_architecture/serializers/json_response_from_result.rb +1 -1
- data/lib/clean_architecture/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: c35339a5f4a1b29b2d14cbeeda0a093c7a3d484e960dc87f8d66c631368ba6a3
|
4
|
+
data.tar.gz: 40ca69149815161a14b1e4405c25711be8ed86c48c3d6713a8b227e3944ff3fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f46c9d37e7681bae1b605e5ecc9611d7847cb0e9319202de6db29cef3eeeaaee2ed4117b985faa96de803dfbfa30a007ba2dd120cf87dea11731eed1255c1846
|
7
|
+
data.tar.gz: 2a8312ffba474756ecd37693ba03b72f47ca9dcd6bb3a2161f2e5770434141234e9f23df6b5feef8dac51f08b4aad4bdd57eab9a143e778a098a3f4f5d50da83
|
data/CHANGELOG.md
CHANGED
@@ -10,7 +10,7 @@ module CleanArchitecture
|
|
10
10
|
class UseCaseResult
|
11
11
|
extend T::Sig
|
12
12
|
|
13
|
-
sig { params(result: Dry::Monads::Result[
|
13
|
+
sig { params(result: Dry::Monads::Result[Entities::FailureDetails, T.untyped], block: T.untyped).returns(T.untyped) }
|
14
14
|
def self.call(result, &block)
|
15
15
|
new.matcher.call(result, &block)
|
16
16
|
end
|
@@ -34,24 +34,9 @@ module CleanArchitecture
|
|
34
34
|
def failure_case
|
35
35
|
Dry::Matcher::Case.new(
|
36
36
|
match: ->(value) { value.is_a?(Dry::Monads::Failure) },
|
37
|
-
resolve: ->(value) {
|
37
|
+
resolve: ->(value) { value.failure }
|
38
38
|
)
|
39
39
|
end
|
40
|
-
|
41
|
-
sig { params(value: Dry::Monads::Result[T.any(T::Array[Object], String, Entities::FailureDetails), T.untyped]).returns(Entities::FailureDetails) }
|
42
|
-
def resolve_failure_value(value)
|
43
|
-
failure = value.failure
|
44
|
-
case failure
|
45
|
-
when Array
|
46
|
-
Entities::FailureDetails.from_array(failure)
|
47
|
-
when String
|
48
|
-
Entities::FailureDetails.from_string(failure)
|
49
|
-
when Entities::FailureDetails
|
50
|
-
failure
|
51
|
-
else
|
52
|
-
T.absurd(failure)
|
53
|
-
end
|
54
|
-
end
|
55
40
|
end
|
56
41
|
end
|
57
42
|
end
|
@@ -11,7 +11,7 @@ module CleanArchitecture
|
|
11
11
|
class HtmlResponseFromResult
|
12
12
|
extend T::Sig
|
13
13
|
|
14
|
-
sig { params(result: Dry::Monads::Result[
|
14
|
+
sig { params(result: Dry::Monads::Result[Entities::FailureDetails, T.untyped], http_method: String).void }
|
15
15
|
def initialize(result, http_method)
|
16
16
|
@result = result
|
17
17
|
@http_method = http_method
|
@@ -12,7 +12,7 @@ module CleanArchitecture
|
|
12
12
|
class JsonResponseFromResult
|
13
13
|
extend T::Sig
|
14
14
|
|
15
|
-
sig { params(result: Dry::Monads::Result[
|
15
|
+
sig { params(result: Dry::Monads::Result[Entities::FailureDetails, T.untyped], http_method: String, success_payload_proc: T.proc.params(success_value: T.untyped).returns(T::Hash[T.untyped, T.untyped])).void }
|
16
16
|
def initialize(result, http_method, success_payload_proc)
|
17
17
|
@result = result
|
18
18
|
@http_method = http_method
|