@Override public final int compareTo(IRubyObject other) { switch (other.getMetaClass().index) { case ClassIndex.FIXNUM: case ClassIndex.BIGNUM: case ClassIndex.FLOAT: return Double.compare(value, ((RubyNumeric) other).getDoubleValue()); default: return (int)coerceCmp(getRuntime().getCurrentContext(), "<=>", other).convertToInteger().getLongValue(); } }
@Override public final int compareTo(IRubyObject other) { switch (other.getMetaClass().index) { case ClassIndex.FIXNUM: case ClassIndex.BIGNUM: case ClassIndex.FLOAT: return Double.compare(value, ((RubyNumeric) other).getDoubleValue()); default: return (int)coerceCmp(getRuntime().getCurrentContext(), "<=>", other).convertToInteger().getLongValue(); } }
@Override public final int compareTo(IRubyObject other) { switch (other.getMetaClass().getClassIndex()) { case INTEGER: case FLOAT: return Double.compare(value, ((RubyNumeric) other).getDoubleValue()); default: ThreadContext context = getRuntime().getCurrentContext(); return (int) coerceCmp(context, sites(context).op_cmp, other).convertToInteger().getLongValue(); } }
@Override public final int compareTo(IRubyObject other) { switch (other.getMetaClass().getClassIndex()) { case INTEGER: case FLOAT: return Double.compare(value, ((RubyNumeric) other).getDoubleValue()); default: ThreadContext context = getRuntime().getCurrentContext(); return (int) coerceCmp(context, sites(context).op_cmp, other).convertToInteger().getLongValue(); } }
return coerceCmp(context, sites.op_cmp, other);
return coerceCmp(context, sites.op_cmp, other);
return coerceCmp(context, "<=>", other);
return coerceCmp(context, "<=>", other);