Sha256: 1a2a74406f4978bfc0e3d0facfe23d82a95a75d7d8ed80034016c72a833944a3

Contents?: true

Size: 504 Bytes

Versions: 13

Compression:

Stored size: 504 Bytes

Contents

module Quebert
  module AsyncSender
    # Perform jobs on Object methods (not instances)
    module Object
      class ObjectJob < Job
        def perform(const, meth, *args)
          Support.constantize(const).send(meth, *args)
        end
      end
      
      def self.included(base)
        base.send(:extend, ClassMethods)
      end
      
      module ClassMethods
        def async_send(meth, *args)
          ObjectJob.new(self.name, meth, *args).enqueue
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
quebert-1.12.0 lib/quebert/async_sender/object.rb
quebert-1.11.0 lib/quebert/async_sender/object.rb
quebert-1.0.9 lib/quebert/async_sender/object.rb
quebert-1.0.8 lib/quebert/async_sender/object.rb
quebert-1.0.7 lib/quebert/async_sender/object.rb
quebert-1.0.6 lib/quebert/async_sender/object.rb
quebert-1.0.5 lib/quebert/async_sender/object.rb
quebert-1.0.4 lib/quebert/async_sender/object.rb
quebert-1.0.2 lib/quebert/async_sender/object.rb
quebert-1.0.1 lib/quebert/async_sender/object.rb
quebert-1.0.0 lib/quebert/async_sender/object.rb
quebert-0.0.9 lib/quebert/async_sender/object.rb
quebert-0.0.8 lib/quebert/async_sender/object.rb