示例#1
0
  public static RubyString getArgumentDefinition(
      Ruby runtime,
      ThreadContext context,
      Node node,
      RubyString type,
      IRubyObject self,
      Block block) {
    if (node == null) return type;

    if (node instanceof ArrayNode) {
      ArrayNode list = (ArrayNode) node;
      int size = list.size();

      for (int i = 0; i < size; i++) {
        if (list.get(i).definition(runtime, context, self, block) == null) return null;
      }
    } else if (node.definition(runtime, context, self, block) == null) {
      return null;
    }

    return type;
  }
示例#2
0
 @Override
 public IRubyObject interpret(
     Ruby runtime, ThreadContext context, IRubyObject self, Block aBlock) {
   RubyString definition = expressionNode.definition(runtime, context, self, aBlock);
   return definition != null ? definition : runtime.getNil();
 }