Class: JobNotifier::Logger

Inherits:
Object
  • Object
show all
Defined in:
lib/job_notifier/logger.rb

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ Logger

Returns a new instance of Logger.



3
4
5
# File 'lib/job_notifier/logger.rb', line 3

def initialize(app)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/job_notifier/logger.rb', line 7

def call(env)
  response = @app.call(env)
  status = response[0]
  return response if status != 200
  log_jobs_info(response[2]) if env["PATH_INFO"] =~ %r{\/\w+\/jobs\/\w+.json}
  response
end