bizness 0.3.3 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bizness/operation.rb +19 -1
- data/lib/bizness/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 627e0236127d263cb8d8a9a04146d13c64f280eb
|
4
|
+
data.tar.gz: d78a718458b648e9fc75ff2589820d799dc54b6a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fbcd7756c2bf5161d1edf5b18432e99f099348fe0aedcd03c1052fcf9ff9d4236e993b8b86079dfb7de84d1af558e439421dd4d4739d65d2be0fe4ab00cbe3a9
|
7
|
+
data.tar.gz: 9100bf843b3850762dbd1f396474cf30c74181dadca2a2ad6c5965fa6299a71772d3f806bfd7fd42ef74674126d26d66ca6be27177e25b03dba615b955be5d6f
|
data/lib/bizness/operation.rb
CHANGED
@@ -1,6 +1,20 @@
|
|
1
1
|
module Bizness::Operation
|
2
2
|
attr_reader :error
|
3
3
|
|
4
|
+
def self.included(base)
|
5
|
+
base.extend(ClassMethods)
|
6
|
+
end
|
7
|
+
|
8
|
+
module ClassMethods
|
9
|
+
def filters(*filter_overrides)
|
10
|
+
@filter_overrides = filter_overrides.flatten.compact
|
11
|
+
end
|
12
|
+
|
13
|
+
def filter_overrides
|
14
|
+
@filter_overrides
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
4
18
|
def call!
|
5
19
|
run
|
6
20
|
successful?
|
@@ -28,8 +42,12 @@ module Bizness::Operation
|
|
28
42
|
|
29
43
|
private
|
30
44
|
|
45
|
+
def filter_overrides
|
46
|
+
Array(self.class.filter_overrides).flatten.compact.empty? ? Bizness.filters : self.class.filter_overrides
|
47
|
+
end
|
48
|
+
|
31
49
|
def run
|
32
|
-
Bizness.run(self)
|
50
|
+
Bizness.run(self, filters: filter_overrides)
|
33
51
|
rescue => e
|
34
52
|
self.error = e.message
|
35
53
|
end
|
data/lib/bizness/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bizness
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ShippingEasy
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|