Class: Protobuf::Node::PackageNode
- 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(path_list) ⇒ PackageNode
constructor
A new instance of PackageNode.
Methods inherited from Base
Constructor Details
#initialize(path_list) ⇒ PackageNode
Returns a new instance of PackageNode.
69 70 71 |
# File 'lib/protobuf/compiler/nodes.rb', line 69 def initialize(path_list) @path_list = path_list end |
Instance Method Details
#accept_descriptor_visitor(visitor) ⇒ Object
84 85 86 |
# File 'lib/protobuf/compiler/nodes.rb', line 84 def accept_descriptor_visitor(visitor) visitor.current_descriptor.package = @path_list.join '.' end |
#accept_message_visitor(visitor) ⇒ Object
73 74 75 76 77 78 |
# File 'lib/protobuf/compiler/nodes.rb', line 73 def (visitor) @path_list.each do |path| visitor.write "module #{path.to_s.capitalize}" visitor.increment end end |
#accept_rpc_visitor(visitor) ⇒ Object
80 81 82 |
# File 'lib/protobuf/compiler/nodes.rb', line 80 def accept_rpc_visitor(visitor) visitor.package = @path_list.dup end |