Class: Protobuf::Node::ServiceNode

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, children) ⇒ ServiceNode

Returns a new instance of ServiceNode.



189
190
191
# File 'lib/protobuf/compiler/nodes.rb', line 189

def initialize(name, children)
  @name, @children = name, children
end

Instance Method Details

#accept_descriptor_visitor(visitor) ⇒ Object



202
203
204
205
206
207
208
# File 'lib/protobuf/compiler/nodes.rb', line 202

def accept_descriptor_visitor(visitor)
  descriptor = Google::Protobuf::ServiceDescriptorProto.new :name => @name.to_s
  visitor.service_descriptor = descriptor
  visitor.in_context descriptor do 
    @children.each {|child| child.accept_descriptor_visitor visitor}
  end
end

#accept_message_visitor(visitor) ⇒ Object



193
194
195
# File 'lib/protobuf/compiler/nodes.rb', line 193

def accept_message_visitor(visitor)
  # do nothing
end

#accept_rpc_visitor(visitor) ⇒ Object



197
198
199
200
# File 'lib/protobuf/compiler/nodes.rb', line 197

def accept_rpc_visitor(visitor)
  visitor.current_service = @name
  @children.each {|child| child.accept_rpc_visitor visitor}
end