Class: LogStruct::Log::ActionMailer::Delivery
- Inherits:
-
T::Struct
- Object
- T::Struct
- LogStruct::Log::ActionMailer::Delivery
- Extended by:
- T::Sig
- Includes:
- Interfaces::AdditionalDataField, Interfaces::CommonFields, Shared::MergeAdditionalDataFields, Shared::SerializeCommon
- Defined in:
- lib/log_struct/log/action_mailer/delivery.rb
Instance Attribute Summary collapse
-
#additional_data ⇒ Hash{String, Symbol => T.untyped}?
readonly
Returns the value of prop
additional_data. -
#attachment_count ⇒ Integer?
readonly
Returns the value of prop
attachment_count. -
#event ⇒ Event
readonly
Returns the value of prop
event. -
#from ⇒ String?
readonly
Returns the value of prop
from. -
#level ⇒ Level
readonly
Returns the value of prop
level. -
#mailer_action ⇒ String?
readonly
Returns the value of prop
mailer_action. -
#mailer_class ⇒ String?
readonly
Returns the value of prop
mailer_class. -
#message_id ⇒ String?
readonly
Returns the value of prop
message_id. -
#source ⇒ Source::Mailer
readonly
Shared/common fields.
-
#subject ⇒ String?
readonly
Returns the value of prop
subject. -
#timestamp ⇒ Time
readonly
Returns the value of prop
timestamp. -
#to ⇒ Array<String>?
readonly
Returns the value of prop
to.
Instance Method Summary collapse
- #initialize(source: Source::Mailer, event: Event::Delivery, timestamp:, level: Level::Info, to: nil, from: nil, subject: nil, message_id: nil, mailer_class: nil, mailer_action: nil, attachment_count: nil, additional_data: nil) ⇒ void constructor
- #to_h ⇒ Hash{LogStruct::LogField => T.untyped}
Methods included from Shared::SerializeCommon
#as_json, #serialize, #serialize_common
Methods included from Interfaces::CommonFields
Methods included from Shared::MergeAdditionalDataFields
Constructor Details
#initialize(source: Source::Mailer, event: Event::Delivery, timestamp:, level: Level::Info, to: nil, from: nil, subject: nil, message_id: nil, mailer_class: nil, mailer_action: nil, attachment_count: nil, additional_data: nil) ⇒ void
|
|
# File '' const :source, Source::Mailer, default: Source::Mailer const :event, Event, default: Event::Delivery const :timestamp, Time, factory: -> { Time.now } const :level, Level, default: Level::Info const :to, T.nilable(T::Array[String]), default: nil const :from, T.nilable(String), default: nil const :subject, T.nilable(String), default: nil const :message_id, T.nilable(String), default: nil const :mailer_class, T.nilable(String), default: nil const :mailer_action, T.nilable(String), default: nil const :attachment_count, T.nilable(Integer), default: nil const :additional_data, T.nilable(T::Hash[T.any(String, Symbol), T.untyped]), default: nil |
Instance Attribute Details
#additional_data ⇒ Hash{String, Symbol => T.untyped}? (readonly)
Returns the value of prop additional_data.
|
|
# File '' const :additional_data, T.nilable(T::Hash[T.any(String, Symbol), T.untyped]), default: nil |
#attachment_count ⇒ Integer? (readonly)
Returns the value of prop attachment_count.
|
|
# File '' const :attachment_count, T.nilable(Integer), default: nil |
#event ⇒ Event (readonly)
Returns the value of prop event.
|
|
# File '' const :event, Event, default: Event::Delivery |
#from ⇒ String? (readonly)
Returns the value of prop from.
|
|
# File '' const :from, T.nilable(String), default: nil |
#level ⇒ Level (readonly)
Returns the value of prop level.
|
|
# File '' const :level, Level, default: Level::Info |
#mailer_action ⇒ String? (readonly)
Returns the value of prop mailer_action.
|
|
# File '' const :mailer_action, T.nilable(String), default: nil |
#mailer_class ⇒ String? (readonly)
Returns the value of prop mailer_class.
|
|
# File '' const :mailer_class, T.nilable(String), default: nil |
#message_id ⇒ String? (readonly)
Returns the value of prop message_id.
|
|
# File '' const :message_id, T.nilable(String), default: nil |
#source ⇒ Source::Mailer (readonly)
Shared/common fields
|
|
# File '' const :source, Source::Mailer, default: Source::Mailer |
#subject ⇒ String? (readonly)
Returns the value of prop subject.
|
|
# File '' const :subject, T.nilable(String), default: nil |
#timestamp ⇒ Time (readonly)
Returns the value of prop timestamp.
|
|
# File '' const :timestamp, Time, factory: -> { Time.now } |
#to ⇒ Array<String>? (readonly)
Returns the value of prop to.
|
|
# File '' const :to, T.nilable(T::Array[String]), default: nil |
Instance Method Details
#to_h ⇒ Hash{LogStruct::LogField => T.untyped}
50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/log_struct/log/action_mailer/delivery.rb', line 50 def to_h h = T.let({}, T::Hash[LogStruct::LogField, T.untyped]) h[LogField::To] = to unless to.nil? h[LogField::From] = from unless from.nil? h[LogField::Subject] = subject unless subject.nil? h[LogField::MessageId] = unless .nil? h[LogField::MailerClass] = mailer_class unless mailer_class.nil? h[LogField::MailerAction] = mailer_action unless mailer_action.nil? h[LogField::AttachmentCount] = unless .nil? h end |