servactory 2.4.0 → 2.4.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: 3996c6a138a1683fe3e46b04e9a57f9e135c93f3fd3855287374595e3b3111b3
4
- data.tar.gz: 72e31e10893e67f5fd57ce54f0241ac35720071d6b1837bda85a953e717c8ae5
3
+ metadata.gz: 39039d8976222bae22b66ec4ee41d231a5ec589509bd32e15c717b0ef6c89d19
4
+ data.tar.gz: 8c4de62f3d586fc7d767d17cd6918b30e7a0521e2bb01e3ed5f69e34b26694db
5
5
  SHA512:
6
- metadata.gz: ec9727d9cd881bfb898f6843488fe7676ba18746ae40fd88e6feb391352c2e6eebf89137ca7d0743577d92caadde20a673973268040c2482eece16af82db2d5b
7
- data.tar.gz: a73916a75bcd4b681ad41fc23ba63546d1a7ae46ff738eeb0f36671f191bd1195c64778e9ea7ddbec80a06c0c14dd46741b43bd521c09a94f9b6eb0cc395ab1f
6
+ metadata.gz: b062e9ceeb16e47ee61133fccda32d8bca81e57424e76a849d7cdf9fb3491016a4a2ca61675142319a11f1286d9bdcc9388db5c4069d8d434df3ab827adc1124
7
+ data.tar.gz: fdd074ac75c620cfdd41a5fb6173d83b7d87835d0bf1a572bf5e815e7f1db028312a6b7afc91c19ad06208917318afe884a87de64685853868c6dea57ab3ff57
@@ -4,41 +4,29 @@ module Servactory
4
4
  module Context
5
5
  module Callable
6
6
  def call!(arguments = {})
7
- prepare_result_class
8
-
9
7
  context = send(:new)
10
8
 
11
9
  _call!(context, **arguments)
12
10
 
13
- self::Result.success_for(context: context)
11
+ Servactory::Result.success_for(context: context)
14
12
  rescue config.success_class => e
15
- self::Result.success_for(context: e.context)
13
+ Servactory::Result.success_for(context: e.context)
16
14
  end
17
15
 
18
16
  def call(arguments = {})
19
- prepare_result_class
20
-
21
17
  context = send(:new)
22
18
 
23
19
  _call!(context, **arguments)
24
20
 
25
- self::Result.success_for(context: context)
21
+ Servactory::Result.success_for(context: context)
26
22
  rescue config.success_class => e
27
- self::Result.success_for(context: e.context)
23
+ Servactory::Result.success_for(context: e.context)
28
24
  rescue config.failure_class => e
29
- self::Result.failure_for(exception: e)
25
+ Servactory::Result.failure_for(exception: e)
30
26
  end
31
27
 
32
28
  private
33
29
 
34
- def prepare_result_class
35
- return if Object.const_defined?("#{name}::Result")
36
-
37
- class_eval <<-RUBY, __FILE__, __LINE__ + 1
38
- Result = Class.new(Servactory::Result)
39
- RUBY
40
- end
41
-
42
30
  def _call!(context, **arguments)
43
31
  context.send(
44
32
  :_call!,
@@ -4,7 +4,7 @@ module Servactory
4
4
  module VERSION
5
5
  MAJOR = 2
6
6
  MINOR = 4
7
- PATCH = 0
7
+ PATCH = 1
8
8
  PRE = nil
9
9
 
10
10
  STRING = [MAJOR, MINOR, PATCH, PRE].compact.join(".")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: servactory
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.0
4
+ version: 2.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anton Sokolov