Class: LogStruct::Log::Puma::Shutdown
- Inherits:
-
T::Struct
- Object
- T::Struct
- LogStruct::Log::Puma::Shutdown
- Extended by:
- T::Sig
- Includes:
- Interfaces::AdditionalDataField, Interfaces::CommonFields, Shared::MergeAdditionalDataFields, Shared::SerializeCommon
- Defined in:
- lib/log_struct/log/puma/shutdown.rb
Instance Attribute Summary collapse
-
#additional_data ⇒ Hash{String, Symbol => T.untyped}?
readonly
Returns the value of prop
additional_data. -
#event ⇒ Event
readonly
Returns the value of prop
event. -
#level ⇒ Level
readonly
Returns the value of prop
level. -
#process_id ⇒ Integer?
readonly
Event-specific fields.
-
#source ⇒ Source::Puma
readonly
Shared/common fields.
-
#timestamp ⇒ Time
readonly
Returns the value of prop
timestamp.
Instance Method Summary collapse
- #initialize(source: Source::Puma, event: Event::Shutdown, timestamp:, level: Level::Info, process_id: nil, additional_data: nil) ⇒ void constructor
- #to_h ⇒ Hash{LogStruct::LogField => T.untyped}
Methods included from Shared::SerializeCommon
#as_json, #serialize, #serialize_common
Methods included from Interfaces::CommonFields
Methods included from Shared::MergeAdditionalDataFields
Constructor Details
#initialize(source: Source::Puma, event: Event::Shutdown, timestamp:, level: Level::Info, process_id: nil, additional_data: nil) ⇒ void
|
|
# File '' const :source, Source::Puma, default: Source::Puma const :event, Event, default: Event::Shutdown const :timestamp, Time, factory: -> { Time.now } const :level, Level, default: Level::Info const :process_id, T.nilable(Integer), default: nil const :additional_data, T.nilable(T::Hash[T.any(String, Symbol), T.untyped]), default: nil |
Instance Attribute Details
#additional_data ⇒ Hash{String, Symbol => T.untyped}? (readonly)
Returns the value of prop additional_data.
|
|
# File '' const :additional_data, T.nilable(T::Hash[T.any(String, Symbol), T.untyped]), default: nil |
#event ⇒ Event (readonly)
Returns the value of prop event.
|
|
# File '' const :event, Event, default: Event::Shutdown |
#level ⇒ Level (readonly)
Returns the value of prop level.
|
|
# File '' const :level, Level, default: Level::Info |
#process_id ⇒ Integer? (readonly)
Event-specific fields
|
|
# File '' const :process_id, T.nilable(Integer), default: nil |
#source ⇒ Source::Puma (readonly)
Shared/common fields
|
|
# File '' const :source, Source::Puma, default: Source::Puma |
#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}
45 46 47 48 49 |
# File 'lib/log_struct/log/puma/shutdown.rb', line 45 def to_h h = T.let({}, T::Hash[LogStruct::LogField, T.untyped]) h[LogField::ProcessId] = process_id unless process_id.nil? h end |