Class: MixpanelMiddleware
- Inherits:
-
Object
- Object
- MixpanelMiddleware
- Defined in:
- lib/mixpanel/mixpanel_middleware.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, mixpanel_token, options = {}) ⇒ MixpanelMiddleware
constructor
A new instance of MixpanelMiddleware.
Constructor Details
#initialize(app, mixpanel_token, options = {}) ⇒ MixpanelMiddleware
Returns a new instance of MixpanelMiddleware.
4 5 6 7 8 9 10 |
# File 'lib/mixpanel/mixpanel_middleware.rb', line 4 def initialize(app, mixpanel_token, ={}) @app = app @token = mixpanel_token @options = { :async => false }.merge() end |
Instance Method Details
#call(env) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/mixpanel/mixpanel_middleware.rb', line 12 def call(env) @env = env @status, @headers, @response = @app.call(env) update_response! update_content_length! delete_event_queue! [@status, @headers, @response] end |