Class: LogStruct::Log::ActiveJob::RetryStopped

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Shared::SerializeCommon

#as_json, #serialize, #serialize_common

Methods included from Interfaces::CommonFieldBase

#serialize

Constructor Details

#initialize(source: Source::Job, event: Event::RetryStopped, timestamp:, level: Level::Info, job_id:, job_class:, queue_name: nil, arguments: nil, executions: nil, provider_job_id: nil, error_class:, message:) ⇒ void

Parameters:

  • source (Source::Job) (defaults to: Source::Job) —

    Shared/common fields

  • event (Event) (defaults to: Event::RetryStopped)
  • timestamp (Time)
  • level (Level) (defaults to: Level::Info)
  • job_id (String)
  • job_class (String)
  • queue_name (Symbol, nil) (defaults to: nil)
  • arguments (Array<T.untyped>, nil) (defaults to: nil)
  • executions (Integer, nil) (defaults to: nil)
  • provider_job_id (String, nil) (defaults to: nil)
  • error_class (T.class_of(Exception)) —

    Event-specific fields

  • message (String)


# File ''

const :source, Source::Job, default: Source::Job
const :event, Event, default: Event::RetryStopped
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 :error_class, T.class_of(Exception)
const :message, String

Instance Attribute Details

#arguments ⇒ Array<T.untyped>? (readonly)

Returns the value of prop arguments.

Returns:

  • (Array<T.untyped>, nil)


# File ''

const :arguments, T.nilable(T::Array[T.untyped]), default: nil

#error_class ⇒ T.class_of(Exception) (readonly)

Event-specific fields

Returns:

  • (T.class_of(Exception))


# File ''

const :error_class, T.class_of(Exception)

#event ⇒ Event (readonly)

Returns the value of prop event.

Returns:



# File ''

const :event, Event, default: Event::RetryStopped

#executions ⇒ Integer? (readonly)

Returns the value of prop executions.

Returns:

  • (Integer, nil)


# File ''

const :executions, T.nilable(Integer), default: nil

#job_class ⇒ String (readonly)

Returns the value of prop job_class.

Returns:

  • (String)


# File ''

const :job_class, String

#job_id ⇒ String (readonly)

Returns the value of prop job_id.

Returns:

  • (String)


# File ''

const :job_id, String

#level ⇒ Level (readonly)

Returns the value of prop level.

Returns:



# File ''

const :level, Level, default: Level::Info

#message ⇒ String (readonly)

Returns the value of prop message.

Returns:

  • (String)


# File ''

const :message, String

#provider_job_id ⇒ String? (readonly)

Returns the value of prop provider_job_id.

Returns:

  • (String, nil)


# File ''

const :provider_job_id, T.nilable(String), default: nil

#queue_name ⇒ Symbol? (readonly)

Returns the value of prop queue_name.

Returns:

  • (Symbol, nil)


# File ''

const :queue_name, T.nilable(Symbol), default: nil

#source ⇒ Source::Job (readonly)

Shared/common fields

Returns:



# File ''

const :source, Source::Job, default: Source::Job

#timestamp ⇒ Time (readonly)

Returns the value of prop timestamp.

Returns:

  • (Time)


# File ''

const :timestamp, Time, factory: -> { Time.now }

Instance Method Details

#to_h ⇒ Hash{LogStruct::LogField => T.untyped}

Returns:



48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/log_struct/log/active_job/retry_stopped.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::ErrorClass] = error_class
  h[LogField::Message] = message
  h
end