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