Class: Protein::HTTPAdapter::Middleware
- Inherits:
-
Object
- Object
- Protein::HTTPAdapter::Middleware
- Defined in:
- lib/protein/http_adapter.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(router, secret) ⇒ Middleware
constructor
A new instance of Middleware.
Constructor Details
#initialize(router, secret) ⇒ Middleware
Returns a new instance of Middleware.
9 10 11 12 |
# File 'lib/protein/http_adapter.rb', line 9 def initialize(router, secret) @router = router @secret = secret end |
Instance Method Details
#call(env) ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/protein/http_adapter.rb', line 14 def call(env) check_secret(env) request_payload = env["rack.input"].read response_payload = Processor.call(@router, request_payload) ["200", {}, [response_payload]] end |