Class: GrpcMock::GrpcStubAdapter::AdapterClass

Inherits:
GRPC::ClientStub
  • Object
show all
Defined in:
lib/grpc_mock/grpc_stub_adapter.rb

Overview

Instance Method Summary collapse

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