Class: LogStruct::Log::ActiveJob::Schedule
- Inherits:
-
T::Struct
- Object
- T::Struct
- LogStruct::Log::ActiveJob::Schedule
- Extended by:
- T::Sig
- Includes:
- Interfaces::CommonFields, Shared::SerializeCommon
- Defined in:
- lib/log_struct/log/active_job/schedule.rb
Instance Attribute Summary collapse
-
#arguments ⇒ Array<T.untyped>?
readonly
Returns the value of prop
arguments. -
#event ⇒ Event
readonly
Returns the value of prop
event. -
#executions ⇒ Integer?
readonly
Returns the value of prop
executions. -
#job_class ⇒ String
readonly
Returns the value of prop
job_class. -
#job_id ⇒ String
readonly
Returns the value of prop
job_id. -
#level ⇒ Level
readonly
Returns the value of prop
level. -
#provider_job_id ⇒ String?
readonly
Returns the value of prop
provider_job_id. -
#queue_name ⇒ Symbol?
readonly
Returns the value of prop
queue_name. -
#scheduled_at ⇒ Time
readonly
Event-specific fields.
-
#source ⇒ Source::Job
readonly
Shared/common fields.
-
#timestamp ⇒ Time
readonly
Returns the value of prop
timestamp.
Instance Method Summary collapse
- #initialize(source: Source::Job, event: Event::Schedule, timestamp:, level: Level::Info, job_id:, job_class:, queue_name: nil, arguments: nil, executions: nil, provider_job_id: nil, scheduled_at:) ⇒ void constructor
- #to_h ⇒ Hash{LogStruct::LogField => T.untyped}
Methods included from Shared::SerializeCommon
#as_json, #serialize, #serialize_common
Methods included from Interfaces::CommonFields
Constructor Details
#initialize(source: Source::Job, event: Event::Schedule, timestamp:, level: Level::Info, job_id:, job_class:, queue_name: nil, arguments: nil, executions: nil, provider_job_id: nil, scheduled_at:) ⇒ void
|
|
# File '' const :source, Source::Job, default: Source::Job const :event, Event, default: Event::Schedule const :timestamp, Time, factory: -> { Time.now } const :level, Level, default: Level::Info const :job_id, String const :job_class, String const :queue_name, T.nilable(Symbol), default: nil const :arguments, T.nilable(T::Array[T.untyped]), default: nil const :executions, T.nilable(Integer), default: nil const :provider_job_id, T.nilable(String), default: nil const :scheduled_at, Time |
Instance Attribute Details
#arguments ⇒ Array<T.untyped>? (readonly)
Returns the value of prop arguments.
|
|
# File '' const :arguments, T.nilable(T::Array[T.untyped]), default: nil |
#event ⇒ Event (readonly)
Returns the value of prop event.
|
|
# File '' const :event, Event, default: Event::Schedule |
#executions ⇒ Integer? (readonly)
Returns the value of prop executions.
|
|
# File '' const :executions, T.nilable(Integer), default: nil |
#job_class ⇒ String (readonly)
Returns the value of prop job_class.
|
|
# File '' const :job_class, String |
#job_id ⇒ String (readonly)
Returns the value of prop job_id.
|
|
# File '' const :job_id, String |
#level ⇒ Level (readonly)
Returns the value of prop level.
|
|
# File '' const :level, Level, default: Level::Info |
#provider_job_id ⇒ String? (readonly)
Returns the value of prop provider_job_id.
|
|
# File '' const :provider_job_id, T.nilable(String), default: nil |
#queue_name ⇒ Symbol? (readonly)
Returns the value of prop queue_name.
|
|
# File '' const :queue_name, T.nilable(Symbol), default: nil |
#scheduled_at ⇒ Time (readonly)
Event-specific fields
|
|
# File '' const :scheduled_at, Time |
#source ⇒ Source::Job (readonly)
Shared/common fields
|
|
# File '' const :source, Source::Job, default: Source::Job |
#timestamp ⇒ Time (readonly)
Returns the value of prop timestamp.
|
|
# File '' const :timestamp, Time, factory: -> { Time.now } |
Instance Method Details
#to_h ⇒ Hash{LogStruct::LogField => T.untyped}
47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/log_struct/log/active_job/schedule.rb', line 47 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::ScheduledAt] = scheduled_at h end |