Package org.jruby.ast

Class ConstDeclNode

All Implemented Interfaces:
INameNode

public class ConstDeclNode extends AssignableNode implements INameNode
Declaration (and assignment) of a Constant.
  • 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
    • getName

      public RubySymbol getName()
      Gets the name (this is the rightmost element of lhs (in Foo::BAR it is BAR). name is the constant Name, it normally starts with a Capital
      Specified by:
      getName in interface INameNode
      Returns:
      name
    • getConstNode

      public Node getConstNode()
      Get the full path, including the name of the new constant (in Foo::BAR it is Foo::BAR) or null. Your probably want to extract the left part with ((Colon2Node) node.getConstNode()).getLeftNode() if node.getConstNode() is a Colon2ConstNode.
      Returns:
      pathNode
    • childNodes

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

      public boolean needsDefinitionCheck()
      Description copied from class: Node
      Check whether the given node is considered always "defined" or whether it has some form of definition check.
      Overrides:
      needsDefinitionCheck in class Node
      Returns:
      Whether the type of node represents a possibly undefined construct