Class: LogStruct::Log::Shrine::Upload

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

Instance Method Summary collapse

Methods included from LogStruct::Log::Shared::SerializeCommon

#as_json, #serialize, #serialize_common

Methods included from Interfaces::CommonFields

#event, #source

Methods included from Interfaces::CommonFieldBase

#level, #serialize, #timestamp

Instance Method Details

#to_hObject



45
46
47
48
49
50
51
52
53
54
# File 'lib/log_struct/log/shrine/upload.rb', line 45

def to_h
  h = T.let({}, T::Hash[LogStruct::LogField, T.untyped])
  h[LogField::Storage] = storage
  h[LogField::Location] = location
  h[LogField::UploadOptions] = upload_options unless upload_options.nil?
  h[LogField::Options] = options unless options.nil?
  h[LogField::Uploader] = uploader unless uploader.nil?
  h[LogField::DurationMs] = duration_ms unless duration_ms.nil?
  h
end