Files

ExceptionNotifiable::ClassMethods

Public Instance Methods

consider_local(*args) click to toggle source
# File lib/exception_notifiable.rb, line 29
def consider_local(*args)
  local_addresses.concat(args.flatten.map { |a| IPAddr.new(a) })
end
exception_data(deliverer=self) click to toggle source
# File lib/exception_notifiable.rb, line 42
def exception_data(deliverer=self)
  if deliverer == self
    read_inheritable_attribute(:exception_data)
  else
    write_inheritable_attribute(:exception_data, deliverer)
  end
end
exceptions_to_treat_as_404() click to toggle source
# File lib/exception_notifiable.rb, line 50
def exceptions_to_treat_as_404
  exceptions = [ActionController::UnknownController, ActionController::UnknownAction]
  exceptions << ActionController::RoutingError if ActionController.const_defined?(:RoutingError)
  exceptions << ActiveRecord::RecordNotFound if Object.const_defined?(:ActiveRecord)
  exceptions
end
local_addresses() click to toggle source
# File lib/exception_notifiable.rb, line 33
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

[Validate]

Generated with the Darkfish Rdoc Generator 2.