Sha256: 418b9c3399457ecdd38394ddd2464fa90f1d7b37d6504568c1ac6903173c5488

Contents?: true

Size: 549 Bytes

Versions: 12

Compression:

Stored size: 549 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, AsyncSender::Promise::DSL)
        base.send(:extend, ClassMethods)
      end
      
      module ClassMethods
        def build_job(meth, *args)
          ObjectJob.new(self.name, meth, *args)
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
quebert-3.3.0 lib/quebert/async_sender/object.rb
quebert-3.2.1 lib/quebert/async_sender/object.rb
quebert-3.2.0 lib/quebert/async_sender/object.rb
quebert-3.0.3 lib/quebert/async_sender/object.rb
quebert-3.0.2 lib/quebert/async_sender/object.rb
quebert-3.0.1 lib/quebert/async_sender/object.rb
quebert-3.0.0 lib/quebert/async_sender/object.rb
quebert-2.0.4 lib/quebert/async_sender/object.rb
quebert-2.0.3 lib/quebert/async_sender/object.rb
quebert-2.0.2 lib/quebert/async_sender/object.rb
quebert-2.0.1 lib/quebert/async_sender/object.rb
quebert-2.0.0 lib/quebert/async_sender/object.rb