diff --git a/example/hello_world/service_twirp.rb b/example/hello_world/service_twirp.rb index 5f41597..a76621a 100644 --- a/example/hello_world/service_twirp.rb +++ b/example/hello_world/service_twirp.rb @@ -4,13 +4,13 @@ module Example module HelloWorld - class HelloWorldService < Twirp::Service + class HelloWorldService < ::Twirp::Service package 'example.hello_world' service 'HelloWorld' rpc :Hello, HelloRequest, HelloResponse, :ruby_method => :hello end - class HelloWorldClient < Twirp::Client + class HelloWorldClient < ::Twirp::Client client_for HelloWorldService end end diff --git a/protoc-gen-twirp_ruby/main.go b/protoc-gen-twirp_ruby/main.go index ae3e39d..618aa8f 100644 --- a/protoc-gen-twirp_ruby/main.go +++ b/protoc-gen-twirp_ruby/main.go @@ -108,7 +108,7 @@ func (g *generator) generateRubyCode(file *descriptor.FileDescriptorProto, pbFil for i, service := range file.Service { svcName := service.GetName() - print(b, "%sclass %sService < Twirp::Service", indent, camelCase(svcName)) + print(b, "%sclass %sService < ::Twirp::Service", indent, camelCase(svcName)) if pkgName != "" { print(b, "%s package '%s'", indent, pkgName) } @@ -123,7 +123,7 @@ func (g *generator) generateRubyCode(file *descriptor.FileDescriptorProto, pbFil print(b, "%send", indent) print(b, "") - print(b, "%sclass %sClient < Twirp::Client", indent, camelCase(svcName)) + print(b, "%sclass %sClient < ::Twirp::Client", indent, camelCase(svcName)) print(b, "%s client_for %sService", indent, camelCase(svcName)) print(b, "%send", indent) if i < len(file.Service)-1 {