Class: EchoService

Inherits:
Object
  • Object
show all
Includes:
GRPC::GenericService
Defined in:
src/ruby/spec/generic/rpc_server_spec.rb

Overview

A test service with an echo implementation.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from GRPC::GenericService

included, underscore

Constructor Details

#initialize(**kw) ⇒ EchoService

Returns a new instance of EchoService.



74
75
76
77
# File 'src/ruby/spec/generic/rpc_server_spec.rb', line 74

def initialize(**kw)
  @trailing_metadata = kw
  @received_md = []
end

Instance Attribute Details

#received_mdObject (readonly)

Returns the value of attribute received_md.



72
73
74
# File 'src/ruby/spec/generic/rpc_server_spec.rb', line 72

def received_md
  @received_md
end

Instance Method Details

#an_rpc(req, call) ⇒ Object



79
80
81
82
83
84
# File 'src/ruby/spec/generic/rpc_server_spec.rb', line 79

def an_rpc(req, call)
  GRPC.logger.info('echo service received a request')
  call..update(@trailing_metadata)
  @received_md << call. unless call..nil?
  req
end