Class: Protobuf::Node::ExtendNode
- Inherits:
-
Base
- Object
- Base
- Protobuf::Node::ExtendNode
- Defined in:
- lib/protobuf/compiler/nodes.rb
Instance Method Summary (collapse)
- - (Object) accept_descriptor_visitor(visitor)
- - (Object) accept_message_visitor(visitor)
-
- (ExtendNode) initialize(name, children)
constructor
A new instance of ExtendNode.
Methods inherited from Base
#accept_rpc_visitor, #define_in_the_file
Constructor Details
- (ExtendNode) initialize(name, children)
A new instance of ExtendNode
128 129 130 |
# File 'lib/protobuf/compiler/nodes.rb', line 128 def initialize(name, children) @name, @children = name, children end |
Instance Method Details
- (Object) accept_descriptor_visitor(visitor)
142 143 144 |
# File 'lib/protobuf/compiler/nodes.rb', line 142 def accept_descriptor_visitor(visitor) # TODO: how should i handle this? end |
- (Object) accept_message_visitor(visitor)
132 133 134 135 136 137 138 139 140 |
# File 'lib/protobuf/compiler/nodes.rb', line 132 def (visitor) name = @name.is_a?(Array) ? @name.join : name.to_s visitor.write("class #{Util.modulize(name)} < ::Protobuf::Message") visitor.in_context(self.class) do define_in_the_file(visitor) @children.each {|child| child.(visitor) } end visitor.write('end') end |