Class: GrpcMock::GrpcStubAdapter::AdapterClass
- Inherits:
-
GRPC::ClientStub
- Object
- GRPC::ClientStub
- GrpcMock::GrpcStubAdapter::AdapterClass
- Defined in:
- lib/grpc_mock/grpc_stub_adapter.rb
Overview
To make hook point for GRPC::ClientStub github.com/grpc/grpc/blob/bec3b5ada2c5e5d782dff0b7b5018df646b65cb0/src/ruby/lib/grpc/generic/service.rb#L150-L186
Instance Method Summary collapse
- #bidi_streamer(method, *args) ⇒ Object
- #client_streamer(method, *args) ⇒ Object
- #request_response(method, *args) ⇒ Object
- #server_streamer(method, *args) ⇒ Object
Instance Method Details
#bidi_streamer(method, *args) ⇒ Object
45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/grpc_mock/grpc_stub_adapter.rb', line 45 def bidi_streamer(method, *args) unless GrpcMock::GrpcStubAdapter.enabled? return super end if GrpcMock.config.allow_net_connect super else raise NetConnectNotAllowedError, method end end |
#client_streamer(method, *args) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/grpc_mock/grpc_stub_adapter.rb', line 21 def client_streamer(method, *args) unless GrpcMock::GrpcStubAdapter.enabled? return super end if GrpcMock.config.allow_net_connect super else raise NetConnectNotAllowedError, method end end |
#request_response(method, *args) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/grpc_mock/grpc_stub_adapter.rb', line 9 def request_response(method, *args) unless GrpcMock::GrpcStubAdapter.enabled? return super end if GrpcMock.config.allow_net_connect super else raise NetConnectNotAllowedError, method end end |
#server_streamer(method, *args) ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/grpc_mock/grpc_stub_adapter.rb', line 33 def server_streamer(method, *args) unless GrpcMock::GrpcStubAdapter.enabled? return super end if GrpcMock.config.allow_net_connect super else raise NetConnectNotAllowedError, method end end |