clean-architecture 4.0.0 → 4.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: be4077eaad5d3e5338312a3d01179b20fed0883fe4ea5ae704d7b68edde2354a
4
- data.tar.gz: e35ac78ba41bbd331092f457794cacfbf64dceba299482fd163c33c2f2a0d206
3
+ metadata.gz: 3b553e98f42ca8f4d8c248a3b4cd8193c139c6ec954f3a8f48159e55071ad3dd
4
+ data.tar.gz: 781afce831f62564aef291aa5f78a589dd0cbf3ad08a7d12c86f6eae7b3f2817
5
5
  SHA512:
6
- metadata.gz: 64a30a1b47e4b03350d5003598c0c2a54df04c5837a264c53a889883938132b8b9c8e118f8855c3d347381e10a1b8cf6839e180580d079884adb7044af1e4c8c
7
- data.tar.gz: 6f3c961a6173becaf70e2862766574670c3f20690fb1f6c2ed6f1082f19941f1034770cb981209a1f187bc488d8848c358f6e88f02bdfa57bc5e44f3f62636ac
6
+ metadata.gz: e2dd17013e0ca6ac9500cb202544f77aec084b9c1e964f21e9eea30df993a3e834bda44118d0340b694b3c52c21836c51e6a5559571fbff1ba95a3c1cc35cb79
7
+ data.tar.gz: e81fb39a065f1c993655e3de55d6e794f1f73e46a1deccee186de9ae116547291421eb92a9c488606d1cf41193d309cddc8acf131793078ce0cf97ff237b355e
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ 4.0.1
2
+
3
+ * CleanArchiecture::Serializers::JsonResponseFromResult: Pass the success value to the proc
4
+
1
5
  4.0.0
2
6
 
3
7
  * Stop trying to be JSON API compliant - we never were and we never will be
@@ -12,11 +12,11 @@ module CleanArchitecture
12
12
  class JsonResponseFromResult
13
13
  extend T::Sig
14
14
 
15
- sig { params(result: Dry::Monads::Result, http_method: String, success_payload_proc: T.proc.returns(T::Hash[T.untyped, T.untyped])).void }
15
+ sig { params(result: Dry::Monads::Result, 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 = T.let(result, Dry::Monads::Result)
18
18
  @http_method = T.let(http_method, String)
19
- @success_payload_proc = T.let(success_payload_proc, T.proc.returns(T::Hash[T.untyped, T.untyped]))
19
+ @success_payload_proc = T.let(success_payload_proc, T.proc.params(success_value: T.untyped).returns(T::Hash[T.untyped, T.untyped]))
20
20
  end
21
21
 
22
22
  sig { returns(T::Hash[Symbol, T.untyped]) }
@@ -42,19 +42,12 @@ module CleanArchitecture
42
42
  sig { returns(T::Hash[Symbol, T.untyped]) }
43
43
  def json
44
44
  Matchers::UseCaseResult.call(@result) do |matcher|
45
- matcher.success { success_payload_data }
45
+ matcher.success { |value| { data: @success_payload_proc.call(value) } }
46
46
  matcher.failure do |failure_details|
47
47
  { errors: [failure_details.message] }
48
48
  end
49
49
  end
50
50
  end
51
-
52
- sig {returns(T::Hash[Symbol, T::Hash[T.untyped, T.untyped]])}
53
- def success_payload_data
54
- {
55
- data: @success_payload_proc.call
56
- }
57
- end
58
51
  end
59
52
  end
60
53
  end
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module CleanArchitecture
5
- VERSION = '4.0.0'
5
+ VERSION = '4.0.1'
6
6
  end
@@ -195,7 +195,7 @@
195
195
  # wrong constant name define_attribute_method
196
196
  # wrong constant name define_attribute_methods
197
197
  # wrong constant name undefine_attribute_methods
198
- # undefined method `initialize<defaultArg>1' for class `#<Class:0x00007ff444bf9218>'
198
+ # undefined method `initialize<defaultArg>1' for class `#<Class:0x00007fc1ce88af08>'
199
199
  # wrong constant name <Class:AttributeMethodMatch>
200
200
  # wrong constant name initialize<defaultArg>1
201
201
  # wrong constant name initialize
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clean-architecture
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bellroy Tech Team