Class: FaradayCage::RackMiddleware

Inherits:
Object
  • Object
show all
Defined in:
lib/faraday_cage/rack_middleware.rb

Overview

Wraps Rack apps to allow identification when running multiple.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ RackMiddleware

Returns a new instance of RackMiddleware.



8
9
10
# File 'lib/faraday_cage/rack_middleware.rb', line 8

def initialize(app)
  @app = app
end

Instance Attribute Details

#appObject (readonly)

Returns the value of attribute app.



6
7
8
# File 'lib/faraday_cage/rack_middleware.rb', line 6

def app
  @app
end

Instance Method Details

#call(env) ⇒ Object



12
13
14
# File 'lib/faraday_cage/rack_middleware.rb', line 12

def call(env)
  identity_request?(env) ? identity : app.call(env)
end