Class: LogStruct::Log::ActiveJob::Finish

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

def to_h
  h = T.let({}, T::Hash[LogStruct::LogField, T.untyped])
  h[LogField::JobId] = job_id
  h[LogField::JobClass] = job_class
  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::ProviderJobId] = provider_job_id unless provider_job_id.nil?
  h[LogField::DurationMs] = duration_ms
  h[LogField::FinishedAt] = finished_at
  h
end