Class: Rusen::Settings

Inherits:
Object
  • Object
show all
Defined in:
lib/rusen/settings.rb

Instance Attribute Summary collapse

Instance Attribute Details

#email_prefixString

Returns the notification email prefix.

Default: ‘[Exception] ’

Returns:

  • (String)


33
34
35
# File 'lib/rusen/settings.rb', line 33

def email_prefix
  @email_prefix || '[Exception] '
end

#email_viaSymbol

Returns the email for email notifications.

Default: :smtp

Returns:

  • (Symbol)


42
43
44
# File 'lib/rusen/settings.rb', line 42

def email_via
  @email_via || :smtp
end

#exception_recipientsArray<String>

Returns the notification email recipients.

Default: []

Returns:

  • (Array<String>)


60
61
62
# File 'lib/rusen/settings.rb', line 60

def exception_recipients
  @exception_recipients || []
end

#exclude_ifBlock

Returns whether to send or not the notification for a exception.

Default: lambda { |exception| false }

Returns:

  • (Block)


87
88
89
# File 'lib/rusen/settings.rb', line 87

def exclude_if
  @exclude_if || lambda { |exception| false }
end

#filter_parametersArray

Note:

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.

Returns:

  • (Array)


101
102
103
104
105
106
107
# File 'lib/rusen/settings.rb', line 101

def filter_parameters
  if @filter_parameter
    @filter_parameters || []
  else
    defined?(Rails) && Rails.application.config.filter_parameters
  end
end

#log4r_config_fileObject

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_nameObject

Returns the value of attribute logger_name.



16
17
18
# File 'lib/rusen/settings.rb', line 16

def logger_name
  @logger_name
end

#outputsArray<Symbol>

Returns the configured outputs.

Default: []

Returns:

  • (Array<Symbol>)


24
25
26
# File 'lib/rusen/settings.rb', line 24

def outputs
  @outputs || []
end

#sectionsArray<Symbol>

Returns the configured sections.

Default: [:backtrace, :request, :session, :environment]

Returns:

  • (Array<Symbol>)


69
70
71
# File 'lib/rusen/settings.rb', line 69

def sections
  @sections || [:backtrace, :request, :session, :environment]
end

#sender_addressString

Returns the notification email sender.

Default: ”

Returns:

  • (String)


51
52
53
# File 'lib/rusen/settings.rb', line 51

def sender_address
  @sender_address || ''
end

#smtp_settingsHash<Symbol, Object>

Returns the email smtp settings.

Default: {}

Returns:

  • (Hash<Symbol, Object>)


78
79
80
# File 'lib/rusen/settings.rb', line 78

def smtp_settings
  @smtp_settings || {}
end