Class: LogStruct::Log::GoodJob::Start

Inherits:
T::Struct
  • Object
show all
Extended by:
T::Sig
Includes:
Interfaces::CommonFields, Shared::SerializeCommon
Defined in:
lib/log_struct/log/good_job/start.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



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

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::ProcessId] = process_id
  h[LogField::ThreadId] = thread_id
  h[LogField::WaitMs] = wait_ms unless wait_ms.nil?
  h[LogField::ScheduledAt] = scheduled_at unless scheduled_at.nil?
  h
end