Sha256: a0e76970ac7f44c672d72f83d5b496b3ebb214193660091c7f1203e50daa145d

Contents?: true

Size: 629 Bytes

Versions: 15

Compression:

Stored size: 629 Bytes

Contents

module MotherBrain
  # A proxy object around a {JobRecord} stored in the {JobManager}. This wrapper object can
  # be returned as a response of the public API to a consumer. A ticket will poll it's
  # referenced {JobRecord} in the {JobManager} for an update about a running or completed {Job}
  #
  # @api public
  class JobTicket < BasicObject
    attr_reader :id

    # @param [Integer] id
    def initialize(id)
      @id = id
    end

    private

      def record
        JobManager.instance.find(id)
      end

      def method_missing(method, *args, &block)
        record.send(method, *args, &block)
      end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
motherbrain-1.5.0 lib/mb/job_ticket.rb
motherbrain-1.4.0 lib/mb/job_ticket.rb
motherbrain-1.3.0 lib/mb/job_ticket.rb
motherbrain-1.2.1 lib/mb/job_ticket.rb
motherbrain-1.2.0 lib/mb/job_ticket.rb
motherbrain-1.1.3 lib/mb/job_ticket.rb
motherbrain-1.1.2 lib/mb/job_ticket.rb
motherbrain-1.1.1 lib/mb/job_ticket.rb
motherbrain-1.1.0 lib/mb/job_ticket.rb
motherbrain-1.0.0 lib/mb/job_ticket.rb
motherbrain-0.14.5 lib/mb/job_ticket.rb
motherbrain-0.14.4 lib/mb/job_ticket.rb
motherbrain-0.14.3 lib/mb/job_ticket.rb
motherbrain-0.14.2 lib/mb/job_ticket.rb
motherbrain-0.13.1 lib/mb/job_ticket.rb