Module: ExceptionLogger::ExceptionLoggable::ClassMethods

Defined in:
lib/exception_logger/exception_loggable.rb

Instance Method Summary collapse

Instance Method Details

#consider_local(*args) ⇒ Object



40
41
42
# File 'lib/exception_logger/exception_loggable.rb', line 40

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

#exception_data(deliverer = self, &block) ⇒ Object



53
54
55
56
57
58
59
60
# File 'lib/exception_logger/exception_loggable.rb', line 53

def exception_data(deliverer = self, &block)
  deliverer = block if block
  if deliverer == self
    self.exception_data
  else
    self.exception_data = deliverer
  end
end

#local_addressesObject



44
45
46
47
48
49
50
51
# File 'lib/exception_logger/exception_loggable.rb', line 44

def local_addresses
  addresses = self.local_addresses
  unless addresses
    addresses = [IPAddr.new("127.0.0.1")]
    self.local_addresses = addresses
  end
  addresses
end