Class: Rafflesia::JobDiagnostic

Inherits:
Types::BaseModel
  • Object
show all
Defined in:
lib/rafflesia/jobs/job_diagnostic.rb

Constant Summary collapse

HASH_ATTRS =
{
  job_id: :job_id,
  last_seen_at: :last_seen_at,
  message: :message,
  observed_at: :observed_at,
  operation: :operation,
  queue_state: :queue_state,
  stale_after_ms: :stale_after_ms,
  status: :status,
  task_id: :task_id,
  type: :type,
  worker_id: :worker_id
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ JobDiagnostic

Returns a new instance of JobDiagnostic.



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/rafflesia/jobs/job_diagnostic.rb', line 35

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @job_id = hash[:job_id]
  @last_seen_at = hash[:last_seen_at]
  @message = hash[:message]
  @observed_at = hash[:observed_at]
  @operation = hash[:operation]
  @queue_state = hash[:queue_state]
  @stale_after_ms = hash[:stale_after_ms]
  @status = hash[:status]
  @task_id = hash[:task_id]
  @type = hash[:type]
  @worker_id = hash[:worker_id]
end

Instance Attribute Details

#job_idObject

Returns the value of attribute job_id.



22
23
24
# File 'lib/rafflesia/jobs/job_diagnostic.rb', line 22

def job_id
  @job_id
end

#last_seen_atObject

Returns the value of attribute last_seen_at.



22
23
24
# File 'lib/rafflesia/jobs/job_diagnostic.rb', line 22

def last_seen_at
  @last_seen_at
end

#messageObject

Returns the value of attribute message.



22
23
24
# File 'lib/rafflesia/jobs/job_diagnostic.rb', line 22

def message
  @message
end

#observed_atObject

Returns the value of attribute observed_at.



22
23
24
# File 'lib/rafflesia/jobs/job_diagnostic.rb', line 22

def observed_at
  @observed_at
end

#operationObject

Returns the value of attribute operation.



22
23
24
# File 'lib/rafflesia/jobs/job_diagnostic.rb', line 22

def operation
  @operation
end

#queue_stateObject

Returns the value of attribute queue_state.



22
23
24
# File 'lib/rafflesia/jobs/job_diagnostic.rb', line 22

def queue_state
  @queue_state
end

#stale_after_msObject

Returns the value of attribute stale_after_ms.



22
23
24
# File 'lib/rafflesia/jobs/job_diagnostic.rb', line 22

def stale_after_ms
  @stale_after_ms
end

#statusObject

Returns the value of attribute status.



22
23
24
# File 'lib/rafflesia/jobs/job_diagnostic.rb', line 22

def status
  @status
end

#task_idObject

Returns the value of attribute task_id.



22
23
24
# File 'lib/rafflesia/jobs/job_diagnostic.rb', line 22

def task_id
  @task_id
end

#typeObject

Returns the value of attribute type.



22
23
24
# File 'lib/rafflesia/jobs/job_diagnostic.rb', line 22

def type
  @type
end

#worker_idObject

Returns the value of attribute worker_id.



22
23
24
# File 'lib/rafflesia/jobs/job_diagnostic.rb', line 22

def worker_id
  @worker_id
end