service_pattern 0.0.5 → 0.0.6

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: 278a1fa25b8d796da5bbd34a1b9f25f4de20bc11e4567290284c04706955e67f
4
- data.tar.gz: 839b2968eeecfcce9319b4730eb6b9f58a0fca4529c8a56c063a588af9d35812
3
+ metadata.gz: c422a0eeb31fd82401662b38f5bf20e8842919a61b9c6ac9679d143284142d8b
4
+ data.tar.gz: 6b4ec9a0abb29917fc473d92ef99e4b8440832afe68e3f2c8387bb8b2a61f70b
5
5
  SHA512:
6
- metadata.gz: f8b6f769bb27497d09a37956659e793ebfd1a57fdfa175070fd0ae731ac60e2738c213c0d3a979cd8c4448fe533dfe7f3aaaea506fe0918e156e7f8a6e29f957
7
- data.tar.gz: c3e7c12b8d3e5bfce1f963e58dd26e0a540b0594deb2bc94fb5b1c46cb196e2424e2f279601f700b30b856bd1022eab818171d20ab9008e64b6cb52d7af51d12
6
+ metadata.gz: 6bce5fc37731897aca940277f54165521d2fc0dd5b0b827abfc6a4a3b720cd2248f1ad68fd46bf2288907aac842df1f5681378d04695db4bfd9383d2f02e7abe
7
+ data.tar.gz: 29f21381d0169db901e5e547e1a538207ef57d1a0f580e1572b8a0256e56a4bf424cc72f99254149923a628003ff515407055c29bb86cdd75a86126f8a40d8ab
@@ -25,7 +25,10 @@ class ServicePattern::Service
25
25
  end
26
26
 
27
27
  def self.execute!(*args, &blk)
28
- response = execute(*args, &blk)
28
+ service = new(*args, &blk)
29
+ can_execute_response = service.can_execute?
30
+ ServicePattern::Service.fail!(can_execute_response.errors) unless can_execute_response.success?
31
+ response = service.execute
29
32
  ServicePattern::Service.fail!(response.errors) unless response.success?
30
33
  response.result
31
34
  end
@@ -1,3 +1,3 @@
1
1
  module ServicePattern
2
- VERSION = "0.0.5".freeze
2
+ VERSION = "0.0.6".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: service_pattern
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - kaspernj
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-31 00:00:00.000000000 Z
11
+ date: 2020-01-18 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: ServicePattern for Ruby on Rails.
14
14
  email: