Class: MotherBrain::JobTicket

Inherits:
BasicObject
Defined in:
lib/mb/job_ticket.rb

Overview

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id) ⇒ JobTicket

Returns a new instance of JobTicket.

Parameters:

  • id (Integer)


11
12
13
# File 'lib/mb/job_ticket.rb', line 11

def initialize(id)
  @id = id
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object (private)



21
22
23
# File 'lib/mb/job_ticket.rb', line 21

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

Instance Attribute Details

#idObject (readonly)



8
9
10
# File 'lib/mb/job_ticket.rb', line 8

def id
  @id
end