Class: LogStruct::Log::GoodJob::Enqueue

Inherits:
T::Struct
  • Object
show all
Extended by:
T::Sig
Includes:
Interfaces::CommonFields, Shared::SerializeCommon
Defined in:
lib/log_struct/log/good_job/enqueue.rb

Instance Method Summary collapse

Methods included from Shared::SerializeCommon

#as_json, #serialize, #serialize_common

Methods included from Interfaces::CommonFields

#event, #source

Methods included from Interfaces::CommonFieldBase

#level, #serialize, #timestamp

Instance Method Details

#to_hObject



48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/log_struct/log/good_job/enqueue.rb', line 48

def to_h
  h = T.let({}, T::Hash[LogStruct::LogField, T.untyped])
  h[LogField::JobId] = job_id unless job_id.nil?
  h[LogField::JobClass] = job_class unless job_class.nil?
  h[LogField::QueueName] = queue_name unless queue_name.nil?
  h[LogField::Arguments] = arguments unless arguments.nil?
  h[LogField::Executions] = executions unless executions.nil?
  h[LogField::DurationMs] = duration_ms
  h[LogField::ScheduledAt] = scheduled_at unless scheduled_at.nil?
  h[LogField::EnqueueCaller] = enqueue_caller unless enqueue_caller.nil?
  h
end