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> Taccept(NodeVisitor<T> iVisitor) Accept for the visitor pattern.booleanGets the body of this class.getCPath()Gets the name.intGets 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:
getNodeTypein classNode- Returns:
- the nodeId
-
accept
Accept for the visitor pattern. -
getBodyNode
Gets the body of this class.- Specified by:
getBodyNodein 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:
getScopein interfaceIScopingNode- Returns:
- the scoping info
-
getCPath
Gets the name.- Specified by:
getCPathin interfaceIScopingNode- Returns:
- Representation of the module path+name
-
childNodes
- Specified by:
childNodesin classNode
-
executesOnce
public boolean executesOnce()- Overrides:
executesOncein 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.
-