Exemplo n.º 1
0
 @JRubyMethod(
     name = {"push", "<<"},
     rest = true)
 public static IRubyObject s_push(IRubyObject recv, IRubyObject[] lines) throws Exception {
   ConsoleHolder holder = getHolder(recv.getRuntime());
   for (int i = 0; i < lines.length; i++) {
     RubyString line = lines[i].convertToString();
     holder.history.addToHistory(line.getUnicodeValue());
   }
   return recv.getRuntime().getNil();
 }