Class: LogStruct::Log::GoodJob::Schedule

Inherits:
T::Struct
  • Object
show all
Extended by:
T::Sig
Includes:
Interfaces::CommonFields, Shared::SerializeCommon
Defined in:
lib/log_struct/log/good_job/schedule.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/schedule.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::DurationMs] = duration_ms
  h[LogField::ScheduledAt] = scheduled_at
  h[LogField::Priority] = priority unless priority.nil?
  h[LogField::CronKey] = cron_key unless cron_key.nil?
  h
end