Sha256: bdd276b7c570e5ccea1d451db301598779ccde5e8d894937e141ff41814266da

Contents?: true

Size: 1.37 KB

Versions: 5

Compression:

Stored size: 1.37 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 <%= Util.underscore(name) %>
## <%= class_indent %>		# TODO: implement <%= Util.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 :<%= Util.underscore(name) %>, <%= request %>, <%= response %>
<%- end -%>
<%= class_indent %>end
<%- (module_array.size-1).downto(0) do |i| -%>
<%= "#{"\t"*i}end" %>
<%- end -%>

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
protobuf-1.4.2 lib/protobuf/compiler/template/rpc_service_implementation.erb
protobuf-1.4.1 lib/protobuf/compiler/template/rpc_service_implementation.erb
protobuf-1.4.0 lib/protobuf/compiler/template/rpc_service_implementation.erb
protobuf-1.3.0 lib/protobuf/compiler/template/rpc_service_implementation.erb
protobuf-1.1.3 lib/protobuf/compiler/template/rpc_service_implementation.erb