Exemple #1
0
 // @RubyLevelMethod(name="scan")
 public RubyValue scan(RubyValue arg, RubyBlock block) {
   RubyRegexp regex = (RubyRegexp) arg;
   if (null != block) {
     regex.scan(sb_.toString(), block);
     return this;
   } else {
     return regex.scan(sb_.toString());
   }
 }
Exemple #2
0
 @Specialization
 public RubyArray scan(RubyString string, RubyRegexp regexp) {
   return RubyArray.specializedFromObjects(
       getContext().getCoreLibrary().getArrayClass(), regexp.scan(string));
 }