From 5417edab2ac816b2ff2d3522c4c6982644dc71d8 Mon Sep 17 00:00:00 2001
From: temiola <temiola@google.com>
Date: Thu, 8 Jan 2015 09:59:08 -0800
Subject: [PATCH] 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

---
 src/compiler/ruby_generator.cc | 5 +++++
 1 file changed, 5 insertions(+)

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);
-- 
GitLab