Class: Rusen::Settings
- Inherits:
-
Object
- Object
- Rusen::Settings
- Defined in:
- lib/rusen/settings.rb
Instance Attribute Summary collapse
-
#email_prefix ⇒ String
Returns the notification email prefix.
-
#email_via ⇒ Symbol
Returns the email for email notifications.
-
#exception_recipients ⇒ Array<String>
Returns the notification email recipients.
-
#exclude_if ⇒ Block
Returns whether to send or not the notification for a exception.
-
#filter_parameters ⇒ Array
Returns the parameters we need to filter from being sent on the notification, this will be used to not send sensitive data to the developers credit card numbers for instance.
-
#log4r_config_file ⇒ Object
Returns the value of attribute log4r_config_file.
-
#logger_name ⇒ Object
Returns the value of attribute logger_name.
-
#outputs ⇒ Array<Symbol>
Returns the configured outputs.
-
#sections ⇒ Array<Symbol>
Returns the configured sections.
-
#sender_address ⇒ String
Returns the notification email sender.
-
#smtp_settings ⇒ Hash<Symbol, Object>
Returns the email smtp settings.
Instance Attribute Details
#email_prefix ⇒ String
Returns the notification email prefix.
Default: ‘[Exception] ’
33 34 35 |
# File 'lib/rusen/settings.rb', line 33 def email_prefix @email_prefix || '[Exception] ' end |
#email_via ⇒ Symbol
Returns the email for email notifications.
Default: :smtp
42 43 44 |
# File 'lib/rusen/settings.rb', line 42 def email_via @email_via || :smtp end |
#exception_recipients ⇒ Array<String>
Returns the notification email recipients.
Default: []
60 61 62 |
# File 'lib/rusen/settings.rb', line 60 def exception_recipients @exception_recipients || [] end |
#exclude_if ⇒ Block
Returns whether to send or not the notification for a exception.
Default: lambda { |exception| false }
87 88 89 |
# File 'lib/rusen/settings.rb', line 87 def exclude_if @exclude_if || lambda { |exception| false } end |
#filter_parameters ⇒ Array
If this is used with a rails app we use the config filter parameters from there if the filter parameters are not defined.
Returns the parameters we need to filter from being sent on
the notification, this will be used to not send sensitive
data to the developers credit card numbers for instance.
101 102 103 104 105 106 107 |
# File 'lib/rusen/settings.rb', line 101 def filter_parameters if @filter_parameters @filter_parameters || [] else defined?(Rails) && Rails.application.config.filter_parameters end end |
#log4r_config_file ⇒ Object
Returns the value of attribute log4r_config_file.
17 18 19 |
# File 'lib/rusen/settings.rb', line 17 def log4r_config_file @log4r_config_file end |
#logger_name ⇒ Object
Returns the value of attribute logger_name.
16 17 18 |
# File 'lib/rusen/settings.rb', line 16 def logger_name @logger_name end |
#outputs ⇒ Array<Symbol>
Returns the configured outputs.
Default: []
24 25 26 |
# File 'lib/rusen/settings.rb', line 24 def outputs @outputs || [] end |
#sections ⇒ Array<Symbol>
Returns the configured sections.
Default: [:backtrace, :request, :session, :environment]
69 70 71 |
# File 'lib/rusen/settings.rb', line 69 def sections @sections || [:backtrace, :request, :session, :environment] end |
#sender_address ⇒ String
Returns the notification email sender.
Default: ”
51 52 53 |
# File 'lib/rusen/settings.rb', line 51 def sender_address @sender_address || '' end |
#smtp_settings ⇒ Hash<Symbol, Object>
Returns the email smtp settings.
Default: {}
78 79 80 |
# File 'lib/rusen/settings.rb', line 78 def smtp_settings @smtp_settings || {} end |