Class: RbPlusPlus::Builders::IncludeNode
- Defined in:
- lib/rbplusplus/builders/include.rb
Overview
Node for an #include line. Can be a :local (default) or :system include declaration.
Includes have no children
Instance Attribute Summary
Attributes inherited from Base
#code, #declarations, #global_nodes, #includes, #nodes, #parent, #registrations, #rice_variable, #rice_variable_type
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(parent, path, type = :local) ⇒ IncludeNode
constructor
A new instance of IncludeNode.
- #write ⇒ Object
Methods inherited from Base
#has_children?, #qualified_name, #sort
Constructor Details
#initialize(parent, path, type = :local) ⇒ IncludeNode
Returns a new instance of IncludeNode.
11 12 13 14 15 16 |
# File 'lib/rbplusplus/builders/include.rb', line 11 def initialize(parent, path, type = :local) super(nil, parent) @path = path @type = type end |
Instance Method Details
#build ⇒ Object
18 19 20 |
# File 'lib/rbplusplus/builders/include.rb', line 18 def build #nop end |
#write ⇒ Object
22 23 24 25 26 |
# File 'lib/rbplusplus/builders/include.rb', line 22 def write if @path includes << (@type == :local ? "#include \"#{@path}\"" : "#include <#{@path}>") end end |