Class: ActionmailLogger::Logger

Inherits:
Object
  • Object
show all
Defined in:
lib/actionmail_logger/logger.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Logger

Returns a new instance of Logger.



4
5
6
# File 'lib/actionmail_logger/logger.rb', line 4

def initialize(options = {})
  @logger = options.fetch(:logger) { Rails.logger }
end

Instance Attribute Details

#loggerObject (readonly)

Returns the value of attribute logger.



3
4
5
# File 'lib/actionmail_logger/logger.rb', line 3

def logger
  @logger
end

Instance Method Details

#deliver!(mail) ⇒ Object



8
9
10
# File 'lib/actionmail_logger/logger.rb', line 8

def deliver!(mail)
  logger.info(mail.encoded)
end