Class: GrpcKit::Interceptors::Client::RequestResponse
- Inherits:
-
Object
- Object
- GrpcKit::Interceptors::Client::RequestResponse
- Defined in:
- lib/grpc_kit/interceptors/request_response.rb
Instance Attribute Summary collapse
-
#interceptors ⇒ Object
writeonly
Sets the attribute interceptors.
Instance Method Summary collapse
-
#initialize ⇒ RequestResponse
constructor
A new instance of RequestResponse.
- #intercept(request, call, metadata, &block) ⇒ Object
Constructor Details
#initialize ⇒ RequestResponse
Returns a new instance of RequestResponse.
9 10 11 12 |
# File 'lib/grpc_kit/interceptors/request_response.rb', line 9 def initialize # Cant' get interceptor at definition time... @interceptors = nil end |
Instance Attribute Details
#interceptors=(value) ⇒ Object (writeonly)
Sets the attribute interceptors
7 8 9 |
# File 'lib/grpc_kit/interceptors/request_response.rb', line 7 def interceptors=(value) @interceptors = value end |
Instance Method Details
#intercept(request, call, metadata, &block) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/grpc_kit/interceptors/request_response.rb', line 14 def intercept(request, call, , &block) if @interceptors && !@interceptors.empty? do_intercept(@interceptors.dup, request, call, , &block) else yield(request, call, ) end end |