Sha256: 97b94e14df3b053751f3ab50ec750df0453f5f81855a5c18ebf79e21b0b6e7fd

Contents?: true

Size: 612 Bytes

Versions: 12

Compression:

Stored size: 612 Bytes

Contents

module Quebert
  module AsyncSender
    # I'm not sure if I want to do this or build serializers per type of object...
    module ActiveRecord
      class RecordJob < Job
        def perform(record, meth, *args)
          record.send(meth, *args)
        end
      end
      
      def self.included(base)
        base.send(:include, AsyncSender::Promise::DSL)
        base.send(:include, AsyncSender::Object)
        base.send(:include, InstanceMethods)
      end

      module InstanceMethods
        def build_job(meth, *args)
          RecordJob.new(self, 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/active_record.rb
quebert-3.2.1 lib/quebert/async_sender/active_record.rb
quebert-3.2.0 lib/quebert/async_sender/active_record.rb
quebert-3.0.3 lib/quebert/async_sender/active_record.rb
quebert-3.0.2 lib/quebert/async_sender/active_record.rb
quebert-3.0.1 lib/quebert/async_sender/active_record.rb
quebert-3.0.0 lib/quebert/async_sender/active_record.rb
quebert-2.0.4 lib/quebert/async_sender/active_record.rb
quebert-2.0.3 lib/quebert/async_sender/active_record.rb
quebert-2.0.2 lib/quebert/async_sender/active_record.rb
quebert-2.0.1 lib/quebert/async_sender/active_record.rb
quebert-2.0.0 lib/quebert/async_sender/active_record.rb