aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/compiler/ruby_generator.cc
diff options
context:
space:
mode:
authorGravatar Jun Mukai <mukai@google.com>2016-04-06 15:21:13 -0700
committerGravatar Jun Mukai <mukai@google.com>2016-04-06 15:25:49 -0700
commitcac9ba4f2268b5bbb8e404d953633d6062a4ffa7 (patch)
tree4e14a159a6829b91e90e13d85a0d67fca6eec9a3 /src/compiler/ruby_generator.cc
parentadc53ade9bbb1cb5efaa6d521e4284061faf2ea5 (diff)
ruby: Use fully-qualified type name when necessary
- Use full_name() instead of name(), otherwise package names are omitted. - Fix a minor bug on RubyTypeOf(), to replace dotted protobuf package name by ruby's module names correctly.
Diffstat (limited to 'src/compiler/ruby_generator.cc')
-rw-r--r--src/compiler/ruby_generator.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/compiler/ruby_generator.cc b/src/compiler/ruby_generator.cc
index 299137519f..5ac56ad289 100644
--- a/src/compiler/ruby_generator.cc
+++ b/src/compiler/ruby_generator.cc
@@ -55,11 +55,11 @@ namespace {
// Prints out the method using the ruby gRPC DSL.
void PrintMethod(const MethodDescriptor *method, const grpc::string &package,
Printer *out) {
- grpc::string input_type = RubyTypeOf(method->input_type()->name(), package);
+ grpc::string input_type = RubyTypeOf(method->input_type()->full_name(), package);
if (method->client_streaming()) {
input_type = "stream(" + input_type + ")";
}
- grpc::string output_type = RubyTypeOf(method->output_type()->name(), package);
+ grpc::string output_type = RubyTypeOf(method->output_type()->full_name(), package);
if (method->server_streaming()) {
output_type = "stream(" + output_type + ")";
}