Sha256: 7214f47e4cba5c4e11781ed32c3f377a06c17eb68d448a7ea94eb101677d424e
Contents?: true
Size: 677 Bytes
Versions: 22
Compression:
Stored size: 677 Bytes
Contents
require 'protobuf/generators/base' module Protobuf module Generators class ServiceGenerator < Base def compile run_once(:compile) do print_class(descriptor.name, :service) do descriptor.method.each do |method_descriptor| puts build_method(method_descriptor) end end end end def build_method(method_descriptor) name = method_descriptor.name request_klass = modulize(method_descriptor.input_type) response_klass = modulize(method_descriptor.output_type) "rpc :#{name.underscore}, #{request_klass}, #{response_klass}" end end end end
Version data entries
22 entries across 22 versions & 2 rubygems