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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b5310639a234a333d6cd85d7b07b40a7ecf462df
4
- data.tar.gz: 26b01d245ecaf5d445bbf57a9eafb98deec1a32f
3
+ metadata.gz: bcdd7291bb1613920df63fceee1e71d63c8fe830
4
+ data.tar.gz: b2054ce41e00fd8ff2dc150465d099abdcb6ede1
5
5
  SHA512:
6
- metadata.gz: 67e612e99136ea39627cd22ff7e724b4468de3f72f03d199b85be434d4277f260159539ee10c0af6e8a8896f09131d9ccebc2c09e9c0733e8c5597fd2b48e7b3
7
- data.tar.gz: 89cb27a4a4847daa55dd2ecdcdcda52d1d505c038138b68cf5f87abca722ea657a63f1d642255632c1277af3f67a3b7d068d242ee906b47f6711099426750e24
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
- @result = result
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) && @common_validation.result &&
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)
@@ -1,3 +1,3 @@
1
1
  module ServicePacker
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.7"
3
3
  end
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
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-04-24 00:00:00.000000000 Z
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.6.8
118
+ rubygems_version: 2.5.1
119
119
  signing_key:
120
120
  specification_version: 4
121
121
  summary: Decouple logic from Model-layer