aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/compiler/ruby_generator.cc
diff options
context:
space:
mode:
authorGravatar temiola <temiola@google.com>2015-01-08 09:59:08 -0800
committerGravatar Nicolas Noble <nnoble@google.com>2015-01-09 17:43:12 -0800
commitd6fd84aff8e14429f26eca344b7418cb73847bf2 (patch)
tree6073b5e87c49efe9a49d0bd22789f6210605cdef /src/compiler/ruby_generator.cc
parent583fe99706f1c0965ae69a4bf36fa6588a956c26 (diff)
Updates the generated ruby code to specify the service name.
Change on 2015/01/08 by temiola <temiola@google.com> ------------- Created by MOE: http://code.google.com/p/moe-java MOE_MIGRATED_REVID=83527066
Diffstat (limited to 'src/compiler/ruby_generator.cc')
-rw-r--r--src/compiler/ruby_generator.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/compiler/ruby_generator.cc b/src/compiler/ruby_generator.cc
index c5c5884736..20485b47a5 100644
--- a/src/compiler/ruby_generator.cc
+++ b/src/compiler/ruby_generator.cc
@@ -104,6 +104,11 @@ void PrintService(const ServiceDescriptor* service, const string& package,
out->Print("\n");
out->Print("self.marshal_class_method = :encode\n");
out->Print("self.unmarshal_class_method = :decode\n");
+ map<string, string> pkg_vars = ListToDict({
+ "service.name", service->name(),
+ "pkg.name", package,
+ });
+ out->Print(pkg_vars, "self.service_name = '$pkg.name$.$service.name$'\n");
out->Print("\n");
for (int i = 0; i < service->method_count(); ++i) {
PrintMethod(service->method(i), package, out);