Class: LogStruct::Log::CarrierWave::Delete

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Shared::SerializeCommon

#as_json, #serialize, #serialize_common

Methods included from Interfaces::CommonFields

#serialize

Constructor Details

#initialize(source: Source::CarrierWave, event: Event::Delete, timestamp:, level: Level::Info, storage:, file_id:, uploader: nil, model: nil, mount_point: nil, version: nil, store_path: nil, extension: nil) ⇒ void

Parameters:

  • source (Source::CarrierWave) (defaults to: Source::CarrierWave)

    Shared/common fields

  • event (Event) (defaults to: Event::Delete)
  • timestamp (Time)
  • level (Level) (defaults to: Level::Info)
  • storage (Symbol)
  • file_id (String)
  • uploader (String, nil) (defaults to: nil)
  • model (String, nil) (defaults to: nil)
  • mount_point (String, nil) (defaults to: nil)
  • version (String, nil) (defaults to: nil)
  • store_path (String, nil) (defaults to: nil)
  • extension (String, nil) (defaults to: nil)


# File ''

const :source, Source::CarrierWave, default: Source::CarrierWave
const :event, Event, default: Event::Delete
const :timestamp, Time, factory: -> { Time.now }
const :level, Level, default: Level::Info
const :storage, Symbol
const :file_id, String
const :uploader, T.nilable(String), default: nil
const :model, T.nilable(String), default: nil
const :mount_point, T.nilable(String), default: nil
const :version, T.nilable(String), default: nil
const :store_path, T.nilable(String), default: nil
const :extension, T.nilable(String), default: nil

Instance Attribute Details

#eventEvent (readonly)

Returns the value of prop event.

Returns:



# File ''

const :event, Event, default: Event::Delete

#extensionString? (readonly)

Returns the value of prop extension.

Returns:

  • (String, nil)


# File ''

const :extension, T.nilable(String), default: nil

#file_idString (readonly)

Returns the value of prop file_id.

Returns:

  • (String)


# File ''

const :file_id, String

#levelLevel (readonly)

Returns the value of prop level.

Returns:



# File ''

const :level, Level, default: Level::Info

#modelString? (readonly)

Returns the value of prop model.

Returns:

  • (String, nil)


# File ''

const :model, T.nilable(String), default: nil

#mount_pointString? (readonly)

Returns the value of prop mount_point.

Returns:

  • (String, nil)


# File ''

const :mount_point, T.nilable(String), default: nil

#sourceSource::CarrierWave (readonly)

Shared/common fields

Returns:



# File ''

const :source, Source::CarrierWave, default: Source::CarrierWave

#storageSymbol (readonly)

Returns the value of prop storage.

Returns:

  • (Symbol)


# File ''

const :storage, Symbol

#store_pathString? (readonly)

Returns the value of prop store_path.

Returns:

  • (String, nil)


# File ''

const :store_path, T.nilable(String), default: nil

#timestampTime (readonly)

Returns the value of prop timestamp.

Returns:

  • (Time)


# File ''

const :timestamp, Time, factory: -> { Time.now }

#uploaderString? (readonly)

Returns the value of prop uploader.

Returns:

  • (String, nil)


# File ''

const :uploader, T.nilable(String), default: nil

#versionString? (readonly)

Returns the value of prop version.

Returns:

  • (String, nil)


# File ''

const :version, T.nilable(String), default: nil

Instance Method Details

#to_hHash{LogStruct::LogField => T.untyped}

Returns:



46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/log_struct/log/carrierwave/delete.rb', line 46

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
end