Example #1
0
 @Specialization
 public RubyString downcase(RubyString string) {
   return string.getRubyClass().getContext().makeString(string.toString().toLowerCase());
 }
Example #2
0
 @Specialization
 public RubyString reverse(RubyString string) {
   return RubyString.fromJavaString(
       string.getRubyClass(), new StringBuilder(string.toString()).reverse().toString());
 }
Example #3
0
 @Specialization
 public RubyString chomp(RubyString string) {
   return string.getRubyClass().getContext().makeString(string.toString().trim());
 }