Class: Johac::Connection::Middleware::RequestCaptureMiddleware

Inherits:
Faraday::Middleware
  • Object
show all
Defined in:
lib/johac/connection.rb

Overview

A request middleware that captures the request and halts the request, if the connections context isn’t nil

Instance Method Summary collapse

Instance Method Details

#call(env) ⇒ Object



124
125
126
127
128
129
130
# File 'lib/johac/connection.rb', line 124

def call(env)
  if env.request.context.kind_of?(Array)
    env.request.context << env
    return false
  end
  @app.call(env)
end