servactory 1.8.8 → 1.9.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4195548749c897719881d14227c7526a0be6097b38123e8556470089e867958a
4
- data.tar.gz: c096b1aacf6217243b1d292afad6cff733dfc955a3d720741de60c5a7d2420cc
3
+ metadata.gz: 8d3dde0507ee0b98c8ab6f6950d76928e1dd378020ac82ed17a05b73c8ad7bc2
4
+ data.tar.gz: edadf08439ecfbdae91640959ba142b055b5c74551c0e48519d0a50fe97a83b0
5
5
  SHA512:
6
- metadata.gz: fff98fb471d49bb6ffda9d31d8daead860313cf12725db2251b22bf69d170bec272376bd71f1f2319ff373c962f6a06822f8e83a435140799d6698acb1454674
7
- data.tar.gz: e333261e7b6a7c5fd8cfc339ac312845bcd89b373100db21d330f89119ea3994fa5c9d66066c8b9b5705e648567513cd1ddbda6907aab4389c6b05475f36ede2
6
+ metadata.gz: 42008a44ef24107e0c4bc9077a6b60efb0d7398d01cb437a553cce74a41ec74f11cc9109e815f5d010c693f9f75f6adc4ecb783fcb67e9b0417a687d4ea5d294
7
+ data.tar.gz: bc500cfae97cc2876f38882ef78bff775d4da7a18bb720a3bb5f3738db3f58d647b72010fd78ba6947a43b5ebee7275c61655683befac7765213069a3e0620a4
@@ -3,11 +3,27 @@
3
3
  module Servactory
4
4
  module TestKit
5
5
  class Result
6
- def initialize(**attributes)
7
- attributes.each_pair do |method_name, method_return|
8
- define_singleton_method(method_name) { method_return }
6
+ def self.as_success(attributes = {})
7
+ Servactory::Result.success_for(context: new(attributes))
8
+ end
9
+
10
+ def self.as_failure(exception: nil)
11
+ Servactory::Result.failure_for(exception: exception)
12
+ end
13
+
14
+ def initialize(attributes = {})
15
+ attributes.each_pair do |name, value|
16
+ service_storage[:outputs].merge!({ name => value })
9
17
  end
10
18
  end
19
+
20
+ private_class_method :new
21
+
22
+ private
23
+
24
+ def service_storage
25
+ @service_storage ||= { outputs: {} }
26
+ end
11
27
  end
12
28
  end
13
29
  end
@@ -3,8 +3,8 @@
3
3
  module Servactory
4
4
  module VERSION
5
5
  MAJOR = 1
6
- MINOR = 8
7
- PATCH = 8
6
+ MINOR = 9
7
+ PATCH = 0
8
8
 
9
9
  STRING = [MAJOR, MINOR, PATCH].join(".")
10
10
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: servactory
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.8
4
+ version: 1.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anton Sokolov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-07-19 00:00:00.000000000 Z
11
+ date: 2023-07-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport