Class: HTTPTracker::Manager

Inherits:
Object
  • Object
show all
Extended by:
ClassMethods
Defined in:
lib/http_tracker/manager.rb

Instance Method Summary collapse

Methods included from ClassMethods

add, clear!

Constructor Details

#initialize(app, options = {}) ⇒ Manager

Returns a new instance of Manager.



5
6
7
8
# File 'lib/http_tracker/manager.rb', line 5

def initialize(app, options = {})
  @app, @options = app, options
  initialize_trackers
end

Instance Method Details

#call(env) ⇒ Object



10
11
12
13
14
15
16
17
18
# File 'lib/http_tracker/manager.rb', line 10

def call(env)
  run_on_request_callbacks!(env)
  
  status, headers, body = @app.call(env)
  
  run_on_response_callbacks!(env, status, headers, body)

  [status, headers, body]
end