Total Complexity | 4 |
Total Lines | 20 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | 1 | module Textris |
|
4 | 1 | class Proxy |
|
5 | 1 | def initialize(texter, options = {}) |
|
6 | 8 | @texter = texter |
|
7 | 8 | @perform_in = options[:perform_in] |
|
8 | 8 | @perform_at = options[:perform_at] |
|
9 | end |
||
10 | |||
11 | 1 | def method_missing(method_name, *args) |
|
12 | 8 | args = ::Textris::Delay::Sidekiq::Serializer.serialize(args) |
|
13 | 8 | args = [@texter, method_name, args] |
|
14 | |||
15 | 8 | if @perform_in |
|
16 | 1 | ::Textris::Delay::Sidekiq::Worker.perform_in(@perform_in, *args) |
|
17 | 7 | elsif @perform_at |
|
18 | 1 | ::Textris::Delay::Sidekiq::Worker.perform_at(@perform_at, *args) |
|
19 | else |
||
20 | 6 | ::Textris::Delay::Sidekiq::Worker.perform_async(*args) |
|
21 | end |
||
22 | end |
||
23 | end |
||
24 | end |
||
27 |