Class: GrpcKit::Interceptors::Server::RequestResponse
- Inherits:
-
Object
- Object
- GrpcKit::Interceptors::Server::RequestResponse
- Defined in:
- lib/grpc_kit/interceptors/request_response.rb
Instance Method Summary collapse
-
#initialize(interceptors) ⇒ RequestResponse
constructor
A new instance of RequestResponse.
- #intercept(request, call, &block) ⇒ Object
Constructor Details
#initialize(interceptors) ⇒ RequestResponse
Returns a new instance of RequestResponse.
41 42 43 |
# File 'lib/grpc_kit/interceptors/request_response.rb', line 41 def initialize(interceptors) @interceptors = interceptors end |
Instance Method Details
#intercept(request, call, &block) ⇒ Object
45 46 47 48 49 50 51 |
# File 'lib/grpc_kit/interceptors/request_response.rb', line 45 def intercept(request, call, &block) if @interceptors && !@interceptors.empty? do_intercept(@interceptors.dup, request, call, &block) else yield(request, call) end end |