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.



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

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

Instance Method Details

#accept_descriptor_visitor(visitor) ⇒ Object



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

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



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

def accept_message_visitor(visitor)
  # do nothing
end

#accept_rpc_visitor(visitor) ⇒ Object



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

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