Class: Protobuf::Node::ImportNode

Inherits:
Base
  • Object
show all
Defined in:
lib/protobuf/compiler/nodes.rb

Instance Method Summary collapse

Methods inherited from Base

#accept_rpc_visitor, #define_in_the_file

Constructor Details

#initialize(path) ⇒ ImportNode

Returns a new instance of ImportNode.



55
56
57
# File 'lib/protobuf/compiler/nodes.rb', line 55

def initialize(path)
  @path = path
end

Instance Method Details

#accept_descriptor_visitor(visitor) ⇒ Object



63
64
65
# File 'lib/protobuf/compiler/nodes.rb', line 63

def accept_descriptor_visitor(visitor)
  visitor.current_descriptor.dependency << @path
end

#accept_message_visitor(visitor) ⇒ Object



59
60
61
# File 'lib/protobuf/compiler/nodes.rb', line 59

def accept_message_visitor(visitor)
  visitor.write "require '#{visitor.required_message_from_proto @path}'"
end