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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 58e5f8d83a30e855fdc66fd073da2dfd8e618607
4
- data.tar.gz: 11a82527d7502d42cbe4fb2170f4b013cdd9c0d1
3
+ metadata.gz: 627e0236127d263cb8d8a9a04146d13c64f280eb
4
+ data.tar.gz: d78a718458b648e9fc75ff2589820d799dc54b6a
5
5
  SHA512:
6
- metadata.gz: 7566b9564a3c1d05605639ef7e074b8ab99d3d6eb954ce766350058070fee043075f31d92985ed8d0bd4a385851c6d514c508a7dcff109951d94bc7064546da7
7
- data.tar.gz: 6c5e178e9dc68a4318bc42a46d9310097f8dcd718bd7893f9ac2171ddd8c3e3a11ea8b6b0e015d5d7a7a7ce46bb7b20ed7d065448319c2a5bd93a845e699c5d8
6
+ metadata.gz: fbcd7756c2bf5161d1edf5b18432e99f099348fe0aedcd03c1052fcf9ff9d4236e993b8b86079dfb7de84d1af558e439421dd4d4739d65d2be0fe4ab00cbe3a9
7
+ data.tar.gz: 9100bf843b3850762dbd1f396474cf30c74181dadca2a2ad6c5965fa6299a71772d3f806bfd7fd42ef74674126d26d66ca6be27177e25b03dba615b955be5d6f
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Bizness
2
- VERSION = "0.3.3"
2
+ VERSION = "0.4.0"
3
3
  end
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.3.3
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-18 00:00:00.000000000 Z
11
+ date: 2015-09-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord