Package org.jruby.ast

Class ModuleNode

java.lang.Object
org.jruby.ast.Node
org.jruby.ast.ModuleNode
All Implemented Interfaces:
IScopingNode

public class ModuleNode extends Node implements IScopingNode
Represents a module definition.
  • Constructor Details

  • Method Details

    • getNodeType

      public NodeType getNodeType()
      Specified by:
      getNodeType in class Node
      Returns:
      the nodeId
    • accept

      public <T> T accept(NodeVisitor<T> iVisitor)
      Accept for the visitor pattern.
      Specified by:
      accept in class Node
      Parameters:
      iVisitor - the visitor
    • getBodyNode

      public Node getBodyNode()
      Gets the body of this class.
      Specified by:
      getBodyNode in interface IScopingNode
      Returns:
      the contents
    • getEndLine

      public int getEndLine()
      Gets line where the 'end' was for this module.
    • getScope

      public StaticScope getScope()
      Get the static scoping information.
      Specified by:
      getScope in interface IScopingNode
      Returns:
      the scoping info
    • getCPath

      public Colon3Node getCPath()
      Gets the name.
      Specified by:
      getCPath in interface IScopingNode
      Returns:
      Representation of the module path+name
    • childNodes

      public List<Node> childNodes()
      Specified by:
      childNodes in class Node
    • executesOnce

      public boolean executesOnce()
      Overrides:
      executesOnce in class Node
      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.