Class: LogStruct::Log::CarrierWave::Upload
- Inherits:
-
T::Struct
- Object
- T::Struct
- LogStruct::Log::CarrierWave::Upload
- Extended by:
- T::Sig
- Includes:
- Interfaces::CommonFields, Shared::SerializeCommon
- Defined in:
- lib/log_struct/log/carrierwave/upload.rb
Instance Method Summary collapse
Methods included from Shared::SerializeCommon
#as_json, #serialize, #serialize_common
Methods included from Interfaces::CommonFields
Methods included from Interfaces::CommonFieldBase
#level, #serialize, #timestamp
Instance Method Details
#to_h ⇒ Object
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/log_struct/log/carrierwave/upload.rb', line 53 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[LogField::Metadata] = unless .nil? h[LogField::DurationMs] = duration_ms unless duration_ms.nil? h end |