Class: LogStruct::Log::ActiveStorage::Exist
- Inherits:
-
T::Struct
- Object
- T::Struct
- LogStruct::Log::ActiveStorage::Exist
- Extended by:
- T::Sig
- Includes:
- Interfaces::CommonFields, Shared::SerializeCommon
- Defined in:
- lib/log_struct/log/active_storage/exist.rb
Instance Attribute Summary collapse
-
#event ⇒ Event
readonly
Returns the value of prop
event. -
#exist ⇒ Boolean?
readonly
Event-specific fields.
-
#file_id ⇒ String
readonly
Returns the value of prop
file_id. -
#level ⇒ Level
readonly
Returns the value of prop
level. -
#source ⇒ Source::Storage
readonly
Shared/common fields.
-
#storage ⇒ Symbol
readonly
Returns the value of prop
storage. -
#timestamp ⇒ Time
readonly
Returns the value of prop
timestamp.
Instance Method Summary collapse
- #initialize(source: Source::Storage, event: Event::Exist, timestamp:, level: Level::Info, storage:, file_id:, exist: 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
Constructor Details
#initialize(source: Source::Storage, event: Event::Exist, timestamp:, level: Level::Info, storage:, file_id:, exist: nil) ⇒ void
|
|
# File '' const :source, Source::Storage, default: Source::Storage const :event, Event, default: Event::Exist const :timestamp, Time, factory: -> { Time.now } const :level, Level, default: Level::Info const :storage, Symbol const :file_id, String const :exist, T.nilable(T::Boolean), default: nil |
Instance Attribute Details
#event ⇒ Event (readonly)
Returns the value of prop event.
|
|
# File '' const :event, Event, default: Event::Exist |
#exist ⇒ Boolean? (readonly)
Event-specific fields
|
|
# File '' const :exist, T.nilable(T::Boolean), default: nil |
#file_id ⇒ String (readonly)
Returns the value of prop file_id.
|
|
# File '' const :file_id, String |
#level ⇒ Level (readonly)
Returns the value of prop level.
|
|
# File '' const :level, Level, default: Level::Info |
#source ⇒ Source::Storage (readonly)
Shared/common fields
|
|
# File '' const :source, Source::Storage, default: Source::Storage |
#storage ⇒ Symbol (readonly)
Returns the value of prop storage.
|
|
# File '' const :storage, Symbol |
#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}
43 44 45 46 47 48 49 |
# File 'lib/log_struct/log/active_storage/exist.rb', line 43 def to_h h = T.let({}, T::Hash[LogStruct::LogField, T.untyped]) h[LogField::Storage] = storage h[LogField::FileId] = file_id h[LogField::Exist] = exist unless exist.nil? h end |