Module: Meta::Execution::MakeToRackMiddleware

Included in:
Application, Application
Defined in:
lib/meta/application/execution.rb

Overview

使得能够处理 Execution 的类作为 Rack 中间件

Instance Method Summary collapse

Instance Method Details

#call(env) ⇒ Object



152
153
154
155
156
157
158
159
160
161
# File 'lib/meta/application/execution.rb', line 152

def call(env)
  # 初始化一个执行环境
  request = Rack::Request.new(env)
  execution = Execution.new(request)

  execute(execution, request.path)

  response = execution.response
  response.to_a
end