Method: Muffler::Config#initialize

Defined in:
lib/muffler/config.rb

#initializeConfig

Returns a new instance of Config.



5
6
7
8
9
10
11
12
13
14
# File 'lib/muffler/config.rb', line 5

def initialize
  @header = 'HTTP_X_MUFFLE_LOGGER' # send in header as X-Muffle-Logger
  @ips = []
  @paths = []
  @mufflers = {}

  muffle_with(:header) { |opts| !opts[@header].nil? }
  muffle_with(:ip)     { |opts| @ips.any? { |ip| ip === opts['REMOTE_ADDR'] } }
  muffle_with(:path)   { |opts| @paths.any? { |path| path === opts['PATH_INFO'] } }
end