Class: Protobuf::Node::RpcNode

Inherits:
Base
  • Object
show all
Defined in:
lib/protobuf/compiler/nodes.rb

Instance Method Summary collapse

Methods inherited from Base

#define_in_the_file

Constructor Details

#initialize(name, request, response) ⇒ RpcNode

Returns a new instance of RpcNode.



210
211
212
# File 'lib/protobuf/compiler/nodes.rb', line 210

def initialize(name, request, response)
  @name, @request, @response = name, request, response
end

Instance Method Details

#accept_descriptor_visitor(visitor) ⇒ Object



222
223
224
225
# File 'lib/protobuf/compiler/nodes.rb', line 222

def accept_descriptor_visitor(visitor)
  descriptor = Google::Protobuf::MethodDescriptorProto.new :name => @name.to_s, :input_type => @request.to_s, :output_type => @response.to_s
  visitor.method_descriptor = descriptor
end

#accept_message_visitor(visitor) ⇒ Object



214
215
216
# File 'lib/protobuf/compiler/nodes.rb', line 214

def accept_message_visitor(visitor)
  # do nothing
end

#accept_rpc_visitor(visitor) ⇒ Object



218
219
220
# File 'lib/protobuf/compiler/nodes.rb', line 218

def accept_rpc_visitor(visitor)
  visitor.add_rpc @name, @request, @response
end