Sha256: ab27b3a00165dc4af217a00b8d76ccffba913db0b539e483d633b9c9b324fe8d

Contents?: true

Size: 925 Bytes

Versions: 2

Compression:

Stored size: 925 Bytes

Contents

module QPush
  module Server
    module Apis
      # A Base class for all API classes.
      #
      class Base
        def self.call(*args)
          api = new(*args)
          api.call
        end

        def initialize(job)
          @job = job
        end
      end
    end

    # The ApiWrapper provides simple functions for all the API
    # classes available for jobs. This provides a single entry point to
    # the API's for job objects.
    #
    module ApiWrapper
      def queue
        Apis::Queue.call(self)
      end

      def perform
        Apis::Perform.call(self)
      end

      def execute
        Apis::Execute.call(self)
      end

      def delay
        Apis::Delay.call(self, :delay)
      end

      def retry
        Apis::Delay.call(self, :retry)
      end

      def morgue
        Apis::Morgue.call(self)
      end

      def setup
        Apis::Setup.call(self)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
qpush-0.1.10 lib/qpush/server/apis.rb
qpush-0.1.8 lib/qpush/server/apis.rb