Sha256: 9d0c6a8e5c1a0812aad6a14b04b8b3b75d6b6c4d10e46c704bee47bccf9e848d

Contents?: true

Size: 1.35 KB

Versions: 7

Compression:

Stored size: 1.35 KB

Contents

<%-
module_array = module_name.split('::')
class_indent = '	'*(module_array.size)
-%>
require 'protobuf/rpc/service'
require '<%= required_file %>'

##	!! DO NOT EDIT THIS FILE !!
## 
##	To implement this service as defined by the protobuf, simply
##	reopen <%= module_name %>::<%= service_name %> and implement each service method:
## 
<%- module_array.each_with_index do |m, i| -%>
## <%= "#{"\t"*i}module #{m}" %>
<%- end -%>
## <%= class_indent %>class <%= service_name %>
## <%= class_indent %>
<%- rpcs.each do |name, request, response| -%>
## <%= class_indent %>	# request -> <%= module_name %>::<%= request %>
## <%= class_indent %>	# response -> <%= module_name %>::<%= response %>
## <%= class_indent %>	def <%= underscore name %>
## <%= class_indent %>		# TODO: implement <%= underscore name %>
## <%= class_indent %>	end
## <%= class_indent %>
<%- end -%>
## <%= class_indent %>end
<%- (module_array.size-1).downto(0) do |i| -%>
## <%= "#{"\t"*i}end" %>
<%- end -%>
##

<%- module_array.each_with_index do |m, i| -%>
<%= "#{"\t"*i}module #{m}" %>
<%- end -%>
<%= class_indent %>class <%= service_name %> < Protobuf::Rpc::Service
<%- rpcs.each do |name, request, response| -%>
<%= class_indent %>  rpc :<%= underscore name %>, <%= request %>, <%= response %>
<%- end -%>
<%= class_indent %>end
<%- (module_array.size-1).downto(0) do |i| -%>
<%= "#{"\t"*i}end" %>
<%- end -%>

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
protobuf-1.1.2 lib/protobuf/compiler/template/rpc_service_implementation.erb
protobuf-1.1.1 lib/protobuf/compiler/template/rpc_service_implementation.erb
protobuf-1.1.0.beta2 lib/protobuf/compiler/template/rpc_service_implementation.erb
protobuf-1.1.0.beta1 lib/protobuf/compiler/template/rpc_service_implementation.erb
protobuf-1.1.0.beta0 lib/protobuf/compiler/template/rpc_service_implementation.erb
protobuf-1.0.1 lib/protobuf/compiler/template/rpc_service_implementation.erb
protobuf-1.0.0 lib/protobuf/compiler/template/rpc_service_implementation.erb