platform/shared/rubyJVM/src/com/xruby/GeneratedMethods/RubySymbol_Methods.java in rhodes-2.0.0.beta1 vs platform/shared/rubyJVM/src/com/xruby/GeneratedMethods/RubySymbol_Methods.java in rhodes-2.0.0.beta2
- old
+ new
@@ -1,8 +1,8 @@
package com.xruby.GeneratedMethods;
+import com.xruby.runtime.builtin.RubyString;
import com.xruby.runtime.lang.*;
-import com.xruby.runtime.lang.RubySymbol;
public class RubySymbol_Methods{
public static void initMethods( RubyClass klass){
klass.defineMethod( "to_sym", new RubyNoArgMethod(){
protected RubyValue run(RubyValue receiver, RubyBlock block ){
@@ -21,9 +21,14 @@
protected RubyValue run(RubyValue receiver, RubyBlock block ){
return ((RubySymbol)receiver).to_s();}
});
klass.aliasMethod("id2name","to_s");
klass.aliasMethod("to_str","to_s");
+
+klass.defineMethod( "length", new RubyNoArgMethod(){
+ protected RubyValue run(RubyValue receiver, RubyBlock block ){
+ return ((RubySymbol)receiver).rubyLength();}
+});
klass.defineMethod( "===", new RubyOneArgMethod(){
protected RubyValue run(RubyValue receiver, RubyValue arg, RubyBlock block ){
return ((RubySymbol)receiver).sym_eqq(arg);}
});