service_pattern 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/service_pattern/response.rb +1 -1
- data/lib/service_pattern/service.rb +5 -2
- data/lib/service_pattern/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8ba006abbb363e6e905b04bc28d034d3ce3500a1972569796b3a4535d399f2a5
|
4
|
+
data.tar.gz: d6843c0cba4fcfe46ea34dc4b7e650a9356566a4e4c6ce2703234a3f44b88ca9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f0069948ebd6189ab2915d74b5a5ef299a61628082b58f8913ec5224746322d4f354542b4ece26d8672d58b38668651bc95b1ab660b2e4cf55bbbb0d2130393
|
7
|
+
data.tar.gz: 1c5dc20138d2d26a3e3b2e93d292861fd981c4fe7afc2a984dc09e48fe46dfd51ac71bd7e9030507a5d4998ff93a9c03c897173a96ef594f2aa410fb524a6b64
|
@@ -33,13 +33,16 @@ class ServicePattern::Service
|
|
33
33
|
response.result
|
34
34
|
end
|
35
35
|
|
36
|
-
def self.
|
36
|
+
def self.convert_errors(errors)
|
37
37
|
errors = [errors] unless errors.is_a?(Array)
|
38
|
-
errors
|
38
|
+
errors.map do |error|
|
39
39
|
error = ServicePattern::FailError.new(message: error) unless error.is_a?(ServicePattern::FailError)
|
40
40
|
error
|
41
41
|
end
|
42
|
+
end
|
42
43
|
|
44
|
+
def self.fail!(errors)
|
45
|
+
errors = convert_errors(errors)
|
43
46
|
error_messages = errors.map(&:message)
|
44
47
|
|
45
48
|
error = ServicePattern::FailedError.new(error_messages.join(". "))
|
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.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kaspernj
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-09-
|
11
|
+
date: 2020-09-03 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: ServicePattern for Ruby on Rails.
|
14
14
|
email:
|