/**
  * Given the root {@link Node} in a JRuby AST will locate the name of the class defined by that
  * AST.
  *
  * @throws IllegalArgumentException if no class is defined by the supplied AST
  */
 private static String findClassName(Node rootNode) {
   ClassNode classNode = findClassNode(rootNode);
   if (classNode == null) {
     throw new IllegalArgumentException(
         "Unable to determine class name for root node '" + rootNode + "'");
   }
   Colon2Node node = (Colon2Node) classNode.getCPath();
   return node.getName();
 }
Exemple #2
0
 private void colon2Node(Colon2Node node) {
   sb.append(" ").append(node.getName());
 }