Package org.jruby.ast
Class ModuleNode
java.lang.Object
org.jruby.ast.Node
org.jruby.ast.ModuleNode
- All Implemented Interfaces:
IScopingNode
Represents a module definition.
-
Field Summary
Fields inherited from class org.jruby.ast.Node
containsVariableAssignment, newline
-
Constructor Summary
ConstructorsConstructorDescriptionModuleNode
(int line, Colon3Node cpath, StaticScope scope, Node bodyNode, int endLine) -
Method Summary
Modifier and TypeMethodDescription<T> T
accept
(NodeVisitor<T> iVisitor) Accept for the visitor pattern.boolean
Gets the body of this class.getCPath()
Gets the name.int
Gets line where the 'end' was for this module.getScope()
Get the static scoping information.Methods inherited from class org.jruby.ast.Node
containsVariableAssignment, createList, createList, createList, createList, getFile, getLine, getNodeName, isNewline, isNil, needsDefinitionCheck, setLine, setNewline, toString, toString, toStringExtraInfo, toStringInternal, unsetNewline
-
Constructor Details
-
ModuleNode
-
-
Method Details
-
getNodeType
- Specified by:
getNodeType
in classNode
- Returns:
- the nodeId
-
accept
Accept for the visitor pattern. -
getBodyNode
Gets the body of this class.- Specified by:
getBodyNode
in interfaceIScopingNode
- Returns:
- the contents
-
getEndLine
public int getEndLine()Gets line where the 'end' was for this module. -
getScope
Get the static scoping information.- Specified by:
getScope
in interfaceIScopingNode
- Returns:
- the scoping info
-
getCPath
Gets the name.- Specified by:
getCPath
in interfaceIScopingNode
- Returns:
- Representation of the module path+name
-
childNodes
- Specified by:
childNodes
in classNode
-
executesOnce
public boolean executesOnce()- Overrides:
executesOnce
in classNode
- Returns:
- is it possible this node will execute only once. Note: This is not comprehensive. It is used to look from root node down to class/module nodes to make sure that narrow case can execute once. It is possible much deeper down the tree some nodes can only execute once but it will be marked as false because that case is not what this is for.
-