lib/sidekiq/cron/job.rb
def parse_args(args)
        case args
        when String
          begin
            Sidekiq.load_json(args)
          rescue JSON::ParserError
            [*args]   # cast to string array
          end
        when Hash
          [args]      # just put hash into array
        when Array
          args        # do nothing, already array
        else
          [*args]     # cast to string array
        end
      end
# Try parsing inbound args into an array.
# args from Redis will be encoded JSON;
# try to load JSON, then failover
# to string array.
Try parsing inbound args into an array.
args from Redis will be encoded JSON;
try to load JSON, then failover
to string array.
Try parsing inbound args into an array . args from Redis will be encoded JSON ; try to load JSON then failover to string array .
def parse_args(args)
        case args
        when String
          begin
            Sidekiq.load_json(args)
          rescue JSON::ParserError
            [*args]   
          end
        when Hash
          [args]      
        when Array
          args        
        else
          [*args]     
        end
      end
def parse_args ( args ) case args when String begin Sidekiq . load_json ( args ) rescue JSON :: ParserError [ * args ] end when Hash [ args ] when Array args else [ * args ] end end
Try parsing inbound args into an array.
Try parsing inbound args into an array .
# cast to string array # just put hash into array # do nothing, already array # cast to string array
args