Class: Mail::Logger::Configuration

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



4
5
6
7
# File 'lib/mail/logger/configuration.rb', line 4

def initialize
  self.log_path = rails_log_path || File.expand_path("./log")
  self.log_file_name = rails_log_file_name || "mail.log"
end

Instance Attribute Details

#log_file_nameObject

Returns the value of attribute log_file_name.



2
3
4
# File 'lib/mail/logger/configuration.rb', line 2

def log_file_name
  @log_file_name
end

#log_pathObject

Returns the value of attribute log_path.



2
3
4
# File 'lib/mail/logger/configuration.rb', line 2

def log_path
  @log_path
end

Instance Method Details

#rails_log_file_nameObject



15
16
17
18
19
# File 'lib/mail/logger/configuration.rb', line 15

def rails_log_file_name
  return nil unless defined? Rails

  "mail_#{Rails.env}.log"
end

#rails_log_pathObject



9
10
11
12
13
# File 'lib/mail/logger/configuration.rb', line 9

def rails_log_path
  return nil unless defined? Rails

  Rails.root.join("log")
end