Class: LogStruct::Log::CarrierWave::Download

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

Instance Method Summary collapse

Methods included from 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



51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/log_struct/log/carrierwave/download.rb', line 51

def to_h
  h = T.let({}, T::Hash[LogStruct::LogField, T.untyped])
  h[LogField::Storage] = storage
  h[LogField::FileId] = file_id
  h[LogField::Uploader] = uploader unless uploader.nil?
  h[LogField::Model] = model unless model.nil?
  h[LogField::MountPoint] = mount_point unless mount_point.nil?
  h[LogField::Version] = version unless version.nil?
  h[LogField::StorePath] = store_path unless store_path.nil?
  h[LogField::Extension] = extension unless extension.nil?
  h[LogField::Filename] = filename unless filename.nil?
  h[LogField::MimeType] = mime_type unless mime_type.nil?
  h[LogField::Size] = size unless size.nil?
  h
end