service_packer 0.0.4 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/service_packer/core/validation.rb +3 -3
- data/lib/service_packer/service.rb +1 -2
- data/lib/service_packer/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bcdd7291bb1613920df63fceee1e71d63c8fe830
|
4
|
+
data.tar.gz: b2054ce41e00fd8ff2dc150465d099abdcb6ede1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 36348f0d610e2857954d1a21d71214f4dcb1981e08af21d81eed96e58e2f7a834f8cc39effce5945b6dcd0a2bb43325b0d7ab97836c62621ae35a32cc0855465
|
7
|
+
data.tar.gz: 23b708c045c82b1cbaaabdaf5f635be7c2ced61d5caa4981d4690ee587cba98c4e2224e32b356112d77e5dcf2ed88fcce3b1b4448a639dbd19f694d703dc33b6
|
@@ -4,15 +4,15 @@ module ServicePacker::Core
|
|
4
4
|
@name = name
|
5
5
|
@args = args
|
6
6
|
@block = block
|
7
|
-
@result = false
|
8
7
|
end
|
9
8
|
|
10
9
|
def invoke(record, *args)
|
11
10
|
result = record.instance_exec(*args, &block)
|
12
11
|
if (result.respond_to?(:errors) && result.errors.empty?) || result == true
|
13
|
-
|
12
|
+
true
|
13
|
+
else
|
14
|
+
false
|
14
15
|
end
|
15
|
-
return result
|
16
16
|
end
|
17
17
|
|
18
18
|
attr_reader :name, :args, :block, :result
|
@@ -49,8 +49,7 @@ module ServicePacker
|
|
49
49
|
end
|
50
50
|
|
51
51
|
def process(record, name, *args)
|
52
|
-
validation_result = @common_validation.invoke(record, *args) && @
|
53
|
-
@validations[name].invoke(record, *args) && @validations[name].result
|
52
|
+
validation_result = @common_validation.invoke(record, *args) && @validations[name].invoke(record, *args)
|
54
53
|
|
55
54
|
if validation_result
|
56
55
|
action_result = @actions[name].invoke(record, *args)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: service_packer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- fuxin
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-06-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|
@@ -115,7 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
115
115
|
version: '0'
|
116
116
|
requirements: []
|
117
117
|
rubyforge_project:
|
118
|
-
rubygems_version: 2.
|
118
|
+
rubygems_version: 2.5.1
|
119
119
|
signing_key:
|
120
120
|
specification_version: 4
|
121
121
|
summary: Decouple logic from Model-layer
|