Class: LogStruct::Log::Shrine::Download
- Inherits:
-
T::Struct
- Object
- T::Struct
- LogStruct::Log::Shrine::Download
- Extended by:
- T::Sig
- Defined in:
- lib/log_struct/log/shrine/download.rb
Instance Attribute Summary collapse
-
#download_options ⇒ Hash{Symbol => T.untyped}?
readonly
Returns the value of prop
download_options. -
#event ⇒ Event
readonly
Returns the value of prop
event. -
#level ⇒ Level
readonly
Returns the value of prop
level. -
#location ⇒ String
readonly
Returns the value of prop
location. -
#source ⇒ Source::Shrine
readonly
Shared/common fields.
-
#storage ⇒ Symbol
readonly
Event-specific fields.
-
#timestamp ⇒ Time
readonly
Returns the value of prop
timestamp.
Instance Method Summary collapse
- #initialize(source: Source::Shrine, event: Event::Download, timestamp:, level: Level::Info, storage:, location:, download_options: nil) ⇒ void constructor
- #to_h ⇒ Hash{LogStruct::LogField => T.untyped}
Methods included from LogStruct::Log::Shared::SerializeCommon
#as_json, #serialize, #serialize_common
Methods included from Interfaces::CommonFields
Constructor Details
#initialize(source: Source::Shrine, event: Event::Download, timestamp:, level: Level::Info, storage:, location:, download_options: nil) ⇒ void
|
|
# File '' const :source, Source::Shrine, default: Source::Shrine const :event, Event, default: Event::Download const :timestamp, Time, factory: -> { Time.now } const :level, Level, default: Level::Info const :storage, Symbol const :location, String const :download_options, T.nilable(T::Hash[Symbol, T.untyped]), default: nil |
Instance Attribute Details
#download_options ⇒ Hash{Symbol => T.untyped}? (readonly)
Returns the value of prop download_options.
|
|
# File '' const :download_options, T.nilable(T::Hash[Symbol, T.untyped]), default: nil |
#event ⇒ Event (readonly)
Returns the value of prop event.
|
|
# File '' const :event, Event, default: Event::Download |
#level ⇒ Level (readonly)
Returns the value of prop level.
|
|
# File '' const :level, Level, default: Level::Info |
#location ⇒ String (readonly)
Returns the value of prop location.
|
|
# File '' const :location, String |
#source ⇒ Source::Shrine (readonly)
Shared/common fields
|
|
# File '' const :source, Source::Shrine, default: Source::Shrine |
#storage ⇒ Symbol (readonly)
Event-specific fields
|
|
# 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}
42 43 44 45 46 47 48 |
# File 'lib/log_struct/log/shrine/download.rb', line 42 def to_h h = T.let({}, T::Hash[LogStruct::LogField, T.untyped]) h[LogField::Storage] = storage h[LogField::Location] = location h[LogField::DownloadOptions] = unless .nil? h end |