From 87b5726919aa774040f7c671b87b9d2d7a7e9657 Mon Sep 17 00:00:00 2001 From: Chris Seelus Date: Wed, 10 Feb 2021 16:57:48 +0100 Subject: [PATCH] Use Ruby 3 conversion kwargs --- lib/crono/job.rb | 2 +- lib/crono/performer_proxy.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/crono/job.rb b/lib/crono/job.rb index be8ee1a..342bf09 100644 --- a/lib/crono/job.rb +++ b/lib/crono/job.rb @@ -76,7 +76,7 @@ module Crono end def perform_job - performer.new.perform *JSON.parse(job_args) + performer.new.perform JSON.parse(job_args) rescue StandardError => e handle_job_fail(e) else diff --git a/lib/crono/performer_proxy.rb b/lib/crono/performer_proxy.rb index 3c1d75e..7bf2699 100644 --- a/lib/crono/performer_proxy.rb +++ b/lib/crono/performer_proxy.rb @@ -7,8 +7,8 @@ module Crono @job_args = job_args end - def every(period, *args) - @job = Job.new(@performer, Period.new(period, *args), @job_args, @options) + def every(period, **options) + @job = Job.new(@performer, Period.new(period, **options), @job_args, @options) @scheduler.add_job(@job) self end