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



187
188
189
# File 'lib/protobuf/compiler/nodes.rb', line 187

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

Instance Method Details

#accept_descriptor_visitor(visitor) ⇒ Object



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

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



191
192
193
# File 'lib/protobuf/compiler/nodes.rb', line 191

def accept_message_visitor(visitor)
  # do nothing
end

#accept_rpc_visitor(visitor) ⇒ Object



195
196
197
198
# File 'lib/protobuf/compiler/nodes.rb', line 195

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