Sha256: ce962787bcb487bf14d63d6e4a6af014586fd9021eb33200509e53d90ac9f0b1

Contents?: true

Size: 735 Bytes

Versions: 8

Compression:

Stored size: 735 Bytes

Contents

require 'protobuf/rpc/server'
require 'protobuf/rpc/handler'
require '<%= required_file %>'

<%- rpcs.each do |name, request, response| -%>
class <%= module_name %>::<%= Util.modulize(name) %>Handler < Protobuf::Rpc::Handler
  request <%= module_name %>::<%= Util.modulize(request) %>
  response <%= module_name %>::<%= Util.modulize(response) %>

  def self.process_request(request, response)
    # TODO: edit this method
  end
end

<%- end -%>
class <%= module_name %>::<%= Util.modulize(service_name) %> < Protobuf::Rpc::Server
  def setup_handlers
    @handlers = {
      <%- rpcs.each do |name, | -%>
      :<%= Util.underscore(name) %> => <%= module_name %>::<%= Util.modulize(name) %>Handler,
      <%- end -%>
    }
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
ruby_protobuf-0.4.11 lib/protobuf/compiler/template/rpc_service.erb
ruby_protobuf-0.4.10 lib/protobuf/compiler/template/rpc_service.erb
ruby_protobuf-0.4.9 lib/protobuf/compiler/template/rpc_service.erb
ruby_protobuf-0.4.8 lib/protobuf/compiler/template/rpc_service.erb
ruby_protobuf-0.4.7 lib/protobuf/compiler/template/rpc_service.erb
ruby_protobuf-0.4.6 lib/protobuf/compiler/template/rpc_service.erb
ruby_protobuf-0.4.5 lib/protobuf/compiler/template/rpc_service.erb
ruby_protobuf-0.4.4 lib/protobuf/compiler/template/rpc_service.erb