Module: ExceptionNotifiable::ClassMethods

Includes:
SuperExceptionNotifier::DeprecatedMethods
Defined in:
lib/exception_notifiable.rb

Instance Method Summary collapse

Methods included from SuperExceptionNotifier::DeprecatedMethods

#deprecation_warning, #exception_notifier_verbose, #exception_notifier_verbose=, #http_error_codes, #http_error_codes=, #notification_level, #notification_level=, #rails_error_codes, #rails_error_codes=, #silent_exceptions, #silent_exceptions=

Instance Method Details

#be_silent_for_exception?(exception) ⇒ Boolean

Returns:

  • (Boolean)


59
60
61
# File 'lib/exception_notifiable.rb', line 59

def be_silent_for_exception?(exception)
  self.exception_notifiable_silent_exceptions.respond_to?(:any?) && self.exception_notifiable_silent_exceptions.any? {|klass| klass === exception }
end

#consider_local(*args) ⇒ Object

specifies ip addresses that should be handled as though local



37
38
39
# File 'lib/exception_notifiable.rb', line 37

def consider_local(*args)
  local_addresses.concat(args.flatten.map { |a| IPAddr.new(a) })
end

#exception_data(deliverer = nil) ⇒ Object

set the exception_data deliverer OR retrieve the exception_data



51
52
53
54
55
56
57
# File 'lib/exception_notifiable.rb', line 51

def exception_data(deliverer = nil)
  if deliverer
    write_inheritable_attribute(:exception_data, deliverer)
  else
    read_inheritable_attribute(:exception_data)
  end
end

#local_addressesObject



41
42
43
44
45
46
47
48
# File 'lib/exception_notifiable.rb', line 41

def local_addresses
  addresses = read_inheritable_attribute(:local_addresses)
  unless addresses
    addresses = [IPAddr.new("127.0.0.1")]
    write_inheritable_attribute(:local_addresses, addresses)
  end
  addresses
end