Merge pull request #22915 from terracatta/patch-1

Convert hash to keyword arguments for ruby 2.7
pull/22927/head
apolcyn 5 years ago committed by GitHub
commit 2c033a8fc2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      src/ruby/lib/grpc/generic/service.rb

@ -167,22 +167,22 @@ module GRPC
if desc.request_response?
define_method(mth_name) do |req, metadata = {}|
GRPC.logger.debug("calling #{@host}:#{route}")
request_response(route, req, marshal, unmarshal, metadata)
request_response(route, req, marshal, unmarshal, **metadata)
end
elsif desc.client_streamer?
define_method(mth_name) do |reqs, metadata = {}|
GRPC.logger.debug("calling #{@host}:#{route}")
client_streamer(route, reqs, marshal, unmarshal, metadata)
client_streamer(route, reqs, marshal, unmarshal, **metadata)
end
elsif desc.server_streamer?
define_method(mth_name) do |req, metadata = {}, &blk|
GRPC.logger.debug("calling #{@host}:#{route}")
server_streamer(route, req, marshal, unmarshal, metadata, &blk)
server_streamer(route, req, marshal, unmarshal, **metadata, &blk)
end
else # is a bidi_stream
define_method(mth_name) do |reqs, metadata = {}, &blk|
GRPC.logger.debug("calling #{@host}:#{route}")
bidi_streamer(route, reqs, marshal, unmarshal, metadata, &blk)
bidi_streamer(route, reqs, marshal, unmarshal, **metadata, &blk)
end
end
end

Loading…
Cancel
Save