Class: Lamian::Middleware

Inherits:
Object
  • Object
show all
Defined in:
lib/lamian/middleware.rb

Overview

Provides rack middleware, which allows to collect request logs

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ Middleware

Returns a new instance of Middleware.

Parameters:

  • app (Proc)

    stored application



8
9
10
# File 'lib/lamian/middleware.rb', line 8

def initialize(app)
  self.app = app
end

Instance Method Details

#call(env) ⇒ Object

wraps application inside lamian context and calls it

Parameters:

  • env (Hash)

    left intact

Returns:

  • result of app.call



15
16
17
# File 'lib/lamian/middleware.rb', line 15

def call(env)
  Lamian.run { app.call(env) }
end