Sha256: 07d2c94234553d517632fa28c5b19f34b3a5963f547c462f51978b35a7894226
Contents?: true
Size: 605 Bytes
Versions: 11
Compression:
Stored size: 605 Bytes
Contents
module Sqewer module Contrib # A job class that can be used to adapt Jobs from ActiveJob and friends. They use # the `perform` method which gets the arguments. class Performable def initialize(performable_class:, perform_arguments:) @class, @args = performable_class, perform_arguments end def to_h {performable_class: @class, perform_arguments: @args} end def inspect '<%s{%s}>' % [@class, @args.inspect] end def run(context) Kernel.const_get(@class).perform(*@args) end end end end
Version data entries
11 entries across 11 versions & 1 rubygems