Class: Rafflesia::JobQueueTask

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

Constant Summary collapse

HASH_ATTRS =
{
  completed_at: :completed_at,
  group: :group,
  is_orphaned: :is_orphaned,
  job_id: :job_id,
  last_error: :last_error,
  last_failed_at: :last_failed_at,
  max_retry: :max_retry,
  next_process_at: :next_process_at,
  payload_hash: :payload_hash,
  queue: :queue,
  retried: :retried,
  state: :state,
  task_id: :task_id,
  type: :type
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ JobQueueTask

Returns a new instance of JobQueueTask.



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/rafflesia/jobs/job_queue_task.rb', line 41

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @completed_at = hash[:completed_at]
  @group = hash[:group]
  @is_orphaned = hash[:is_orphaned]
  @job_id = hash[:job_id]
  @last_error = hash[:last_error]
  @last_failed_at = hash[:last_failed_at]
  @max_retry = hash[:max_retry]
  @next_process_at = hash[:next_process_at]
  @payload_hash = hash[:payload_hash]
  @queue = hash[:queue]
  @retried = hash[:retried]
  @state = hash[:state]
  @task_id = hash[:task_id]
  @type = hash[:type]
end

Instance Attribute Details

#completed_atObject

Returns the value of attribute completed_at.



25
26
27
# File 'lib/rafflesia/jobs/job_queue_task.rb', line 25

def completed_at
  @completed_at
end

#groupObject

Returns the value of attribute group.



25
26
27
# File 'lib/rafflesia/jobs/job_queue_task.rb', line 25

def group
  @group
end

#is_orphanedObject

Returns the value of attribute is_orphaned.



25
26
27
# File 'lib/rafflesia/jobs/job_queue_task.rb', line 25

def is_orphaned
  @is_orphaned
end

#job_idObject

Returns the value of attribute job_id.



25
26
27
# File 'lib/rafflesia/jobs/job_queue_task.rb', line 25

def job_id
  @job_id
end

#last_errorObject

Returns the value of attribute last_error.



25
26
27
# File 'lib/rafflesia/jobs/job_queue_task.rb', line 25

def last_error
  @last_error
end

#last_failed_atObject

Returns the value of attribute last_failed_at.



25
26
27
# File 'lib/rafflesia/jobs/job_queue_task.rb', line 25

def last_failed_at
  @last_failed_at
end

#max_retryObject

Returns the value of attribute max_retry.



25
26
27
# File 'lib/rafflesia/jobs/job_queue_task.rb', line 25

def max_retry
  @max_retry
end

#next_process_atObject

Returns the value of attribute next_process_at.



25
26
27
# File 'lib/rafflesia/jobs/job_queue_task.rb', line 25

def next_process_at
  @next_process_at
end

#payload_hashObject

Returns the value of attribute payload_hash.



25
26
27
# File 'lib/rafflesia/jobs/job_queue_task.rb', line 25

def payload_hash
  @payload_hash
end

#queueObject

Returns the value of attribute queue.



25
26
27
# File 'lib/rafflesia/jobs/job_queue_task.rb', line 25

def queue
  @queue
end

#retriedObject

Returns the value of attribute retried.



25
26
27
# File 'lib/rafflesia/jobs/job_queue_task.rb', line 25

def retried
  @retried
end

#stateObject

Returns the value of attribute state.



25
26
27
# File 'lib/rafflesia/jobs/job_queue_task.rb', line 25

def state
  @state
end

#task_idObject

Returns the value of attribute task_id.



25
26
27
# File 'lib/rafflesia/jobs/job_queue_task.rb', line 25

def task_id
  @task_id
end

#typeObject

Returns the value of attribute type.



25
26
27
# File 'lib/rafflesia/jobs/job_queue_task.rb', line 25

def type
  @type
end