module ExceptionNotification::ExceptionNotifiable::ClassMethods

Public Instance Methods

be_silent_for_exception?(exception) click to toggle source
# File lib/exception_notification/exception_notifiable.rb, line 78
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) click to toggle source

specifies ip addresses that should be handled as though local

# File lib/exception_notification/exception_notifiable.rb, line 56
def consider_local(*args)
  local_addresses.concat(args.flatten.map { |a| IPAddr.new(a) })
end
exception_data(deliverer = nil) click to toggle source

set the exception_data deliverer OR retrieve the exception_data

# File lib/exception_notification/exception_notifiable.rb, line 70
def exception_data(deliverer = nil)
  if deliverer
    write_inheritable_attribute(:exception_data, deliverer)
  else
    read_inheritable_attribute(:exception_data)
  end
end
local_addresses() click to toggle source
# File lib/exception_notification/exception_notifiable.rb, line 60
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