Class: Protobuf::Node::RpcNode
- Defined in:
- lib/protobuf/compiler/nodes.rb
Instance Method Summary collapse
- #accept_descriptor_visitor(visitor) ⇒ Object
- #accept_message_visitor(visitor) ⇒ Object
- #accept_rpc_visitor(visitor) ⇒ Object
-
#initialize(name, request, response) ⇒ RpcNode
constructor
A new instance of RpcNode.
Methods inherited from Base
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 (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 |