operationable 0.3.8 → 0.3.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c3574b3a51213a0a85bbaab99f588b0d2d701a72
4
- data.tar.gz: 243253027cbb504a7d8ae3b9707bb250b05d954e
3
+ metadata.gz: ebe4cc0d9e9e27aaa712fe77e4cacd97c1ed3a62
4
+ data.tar.gz: 14007f5012fbf175bd272edc1bb7e62db4a01322
5
5
  SHA512:
6
- metadata.gz: cfa0941cac79c68e11dd9cbf5d8aa74e128dfeabf484fc118648b44f74ee1c09c9a04109555044dc3b14c21020cd84ec059c278c8366b5c7c4f1afe52dbe6ada
7
- data.tar.gz: 7f0a8004854de22cdf2156369e8196bec36f8167d1121f89c3f158438686c3696624f98a334d787116b2487c27c3742c38c2ff298c5099f8a06adf88d5eaf5d1
6
+ metadata.gz: 9996eb38e79d542c2a4415a2262f28aa2ec8fba423c2b7ccf88d3369bbec6469a660b89c38406c9ead766b9ef2b69ff732fbb4c072f676ed38dca312be7fd80c
7
+ data.tar.gz: 7158b4284326317fa9116e8ff0cc0cdb9a83a17e46b96ac69294bcc44e4bf1038446997e46baae95013a4ca5cf775755ddae2acca3ee46b26588bde461ec683a
@@ -33,10 +33,6 @@ module Operationable
33
33
 
34
34
  end
35
35
 
36
- def job_method
37
- "#{job_class}".constantize.method(perform_method)
38
- end
39
-
40
36
  def job_class
41
37
  'OperationJob'
42
38
  end
@@ -59,8 +55,13 @@ module Operationable
59
55
  end
60
56
 
61
57
  def push_to_queue(*callback_method_names, queue: nil, params: {})
62
- callback_method_names.each do |callback_method_name|
63
- callbacks << { callback_method_name: callback_method_name.to_s, queue: queue.to_s, params: params }
58
+ callback_method_names.each do |callback_method_name, job_class_name|
59
+ callbacks << {
60
+ callback_method_name: callback_method_name.to_s,
61
+ job_class_name: job_class_name.nil? ? job_class.to_s : job_class_name.to_s,
62
+ queue: queue.to_s,
63
+ params: params
64
+ }
64
65
  end
65
66
  end
66
67
 
@@ -6,13 +6,11 @@ module Operationable
6
6
  check_callbacks.each { |callback| process(callback) }
7
7
  end
8
8
 
9
- def process(callback_method_name:, queue: nil, params:)
10
- callback_class = callback_method_name.to_s.safe_constantize
9
+ def process(callback_method_name:, job_class_name: nil, queue: nil, params:)
10
+ # callback can be class
11
+ # callback_class = callback_method_name.to_s.safe_constantize
11
12
 
12
- (queue.blank? ?
13
- self.class :
14
- (callback_class || job_class.constantize).method(perform_method)
15
- ).call(
13
+ (queue.blank? ? self.class : job_class_name.constantize.method(perform_method)).call(
16
14
  q_options: q_options(callback_method_name, queue),
17
15
  props: {**props, **params}
18
16
  )
@@ -7,7 +7,7 @@ module Operationable
7
7
  end
8
8
 
9
9
  def process
10
- (queue.blank? ? self.class : job_method).call(
10
+ (queue.blank? ? self.class : job_class.to_s.constantize.method(perform_method)).call(
11
11
  q_options: q_options,
12
12
  props: props
13
13
  )
@@ -1,3 +1,3 @@
1
1
  module Operationable
2
- VERSION = "0.3.8"
2
+ VERSION = "0.3.9"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: operationable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.8
4
+ version: 0.3.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kirill Suhodolov
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-10-10 00:00:00.000000000 Z
12
+ date: 2019-05-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activejob