Class: Mail::LoggerDelivery
- Inherits:
-
Object
- Object
- Mail::LoggerDelivery
- Defined in:
- lib/mail/network/delivery_methods/logger_delivery.rb
Instance Attribute Summary collapse
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
-
#settings ⇒ Object
readonly
Returns the value of attribute settings.
-
#severity ⇒ Object
readonly
Returns the value of attribute severity.
Instance Method Summary collapse
- #deliver!(mail) ⇒ Object
-
#initialize(settings) ⇒ LoggerDelivery
constructor
A new instance of LoggerDelivery.
Constructor Details
#initialize(settings) ⇒ LoggerDelivery
Returns a new instance of LoggerDelivery.
7 8 9 10 11 |
# File 'lib/mail/network/delivery_methods/logger_delivery.rb', line 7 def initialize(settings) @settings = settings @logger = settings.fetch(:logger) { default_logger } @severity = derive_severity(settings[:severity]) end |
Instance Attribute Details
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
5 6 7 |
# File 'lib/mail/network/delivery_methods/logger_delivery.rb', line 5 def logger @logger end |
#settings ⇒ Object (readonly)
Returns the value of attribute settings.
5 6 7 |
# File 'lib/mail/network/delivery_methods/logger_delivery.rb', line 5 def settings @settings end |
#severity ⇒ Object (readonly)
Returns the value of attribute severity.
5 6 7 |
# File 'lib/mail/network/delivery_methods/logger_delivery.rb', line 5 def severity @severity end |
Instance Method Details
#deliver!(mail) ⇒ Object
13 14 15 |
# File 'lib/mail/network/delivery_methods/logger_delivery.rb', line 13 def deliver!(mail) logger.log(severity) { Mail::SmtpEnvelope.new(mail). } end |