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.



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

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

Instance Method Details

#accept_descriptor_visitor(visitor) ⇒ Object



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

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



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

def accept_message_visitor(visitor)
  # do nothing
end

#accept_rpc_visitor(visitor) ⇒ Object



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

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