Class: LogStruct::Log::Shrine::Delete

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#as_json, #serialize, #serialize_common

Methods included from Interfaces::CommonFields

#serialize

Constructor Details

#initialize(source: Source::Shrine, event: Event::Delete, timestamp:, level: Level::Info, storage:, location:) ⇒ void

Parameters:

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

    Shared/common fields

  • event (Event) (defaults to: Event::Delete)
  • timestamp (Time)
  • level (Level) (defaults to: Level::Info)
  • storage (Symbol)

    Event-specific fields

  • location (String)


# File ''

const :source, Source::Shrine, default: Source::Shrine
const :event, Event, default: Event::Delete
const :timestamp, Time, factory: -> { Time.now }
const :level, Level, default: Level::Info
const :storage, Symbol
const :location, String

Instance Attribute Details

#eventEvent (readonly)

Returns the value of prop event.

Returns:



# File ''

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

#levelLevel (readonly)

Returns the value of prop level.

Returns:



# File ''

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

#locationString (readonly)

Returns the value of prop location.

Returns:

  • (String)


# File ''

const :location, String

#sourceSource::Shrine (readonly)

Shared/common fields

Returns:



# File ''

const :source, Source::Shrine, default: Source::Shrine

#storageSymbol (readonly)

Event-specific fields

Returns:

  • (Symbol)


# File ''

const :storage, Symbol

#timestampTime (readonly)

Returns the value of prop timestamp.

Returns:

  • (Time)


# File ''

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

Instance Method Details

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

Returns:



41
42
43
44
45
46
# File 'lib/log_struct/log/shrine/delete.rb', line 41

def to_h
  h = T.let({}, T::Hash[LogStruct::LogField, T.untyped])
  h[LogField::Storage] = storage
  h[LogField::Location] = location
  h
end