public void marshalTo(Ruby runtime, Object obj, RubyClass type, MarshalStream marshalStream) throws IOException { defaultMarshal.marshalTo(runtime, obj, type, marshalStream); }
public Object unmarshalFrom(Ruby runtime, RubyClass type, UnmarshalStream unmarshalStream) throws IOException { Object result = defaultMarshal.unmarshalFrom(runtime, type, unmarshalStream); ((RubySet) result).unmarshal(); return result; }
public final Object unmarshal(UnmarshalStream unmarshalStream) throws IOException { return getMarshal().unmarshalFrom(runtime, this, unmarshalStream); }
public void marshalTo(Ruby runtime, Object obj, RubyClass type, MarshalStream marshalStream) throws IOException { defaultMarshal.marshalTo(runtime, obj, type, marshalStream); }
public final Object unmarshal(UnmarshalStream unmarshalStream) throws IOException { return getMarshal().unmarshalFrom(runtime, this, unmarshalStream); }
public final void marshal(Object obj, MarshalStream marshalStream) throws IOException { getMarshal().marshalTo(runtime, obj, this, marshalStream); }
public Object unmarshalFrom(Ruby runtime, RubyClass type, UnmarshalStream unmarshalStream) throws IOException { Object result = defaultMarshal.unmarshalFrom(runtime, type, unmarshalStream); ((RubySet) result).unmarshal(); return result; }
public final void marshal(Object obj, MarshalStream marshalStream) throws IOException { getMarshal().marshalTo(runtime, obj, this, marshalStream); }
public final Object unmarshal(UnmarshalStream unmarshalStream) throws IOException { return getMarshal().unmarshalFrom(runtime, this, unmarshalStream); }
public final void marshal(Object obj, MarshalStream marshalStream) throws IOException { getMarshal().marshalTo(runtime, obj, this, marshalStream); }
public final Object unmarshal(UnmarshalStream unmarshalStream) throws IOException { return getMarshal().unmarshalFrom(runtime, this, unmarshalStream); }
public final void marshal(Object obj, MarshalStream marshalStream) throws IOException { getMarshal().marshalTo(runtime, obj, this, marshalStream); }
public Object unmarshalFrom(Ruby runtime, RubyClass type, UnmarshalStream unmarshalStream) throws IOException { RubyRational r = (RubyRational) RubyClass.DEFAULT_OBJECT_MARSHAL.unmarshalFrom(runtime, type, unmarshalStream); r.num = r.removeInstanceVariable("@numerator"); r.den = r.removeInstanceVariable("@denominator"); return r; } };
public Object unmarshalFrom(Ruby runtime, RubyClass type, UnmarshalStream unmarshalStream) throws IOException { RubyRational r = (RubyRational) RubyClass.DEFAULT_OBJECT_MARSHAL.unmarshalFrom(runtime, type, unmarshalStream); r.num = r.removeInstanceVariable("@numerator"); r.den = r.removeInstanceVariable("@denominator"); return r; } };
@Override public Object unmarshalFrom(Ruby runtime, RubyClass type, UnmarshalStream unmarshalStream) throws IOException { ThreadContext context = runtime.getCurrentContext(); RubyRational r = (RubyRational) RubyClass.DEFAULT_OBJECT_MARSHAL.unmarshalFrom(runtime, type, unmarshalStream); RubyInteger num = intCheck(context, r.removeInstanceVariable("@numerator")); RubyInteger den = intCheck(context, r.removeInstanceVariable("@denominator")); // MRI: nurat_canonicalize, negation part if (canonicalizeShouldNegate(context, den)) { num = num.negate(); den = den.negate(); } r.num = num; r.den = den; return r; } };
@Override public Object unmarshalFrom(Ruby runtime, RubyClass type, UnmarshalStream unmarshalStream) throws IOException { ThreadContext context = runtime.getCurrentContext(); RubyRational r = (RubyRational) RubyClass.DEFAULT_OBJECT_MARSHAL.unmarshalFrom(runtime, type, unmarshalStream); RubyInteger num = intCheck(context, r.removeInstanceVariable("@numerator")); RubyInteger den = intCheck(context, r.removeInstanceVariable("@denominator")); // MRI: nurat_canonicalize, negation part if (canonicalizeShouldNegate(context, den)) { num = num.negate(); den = den.negate(); } r.num = num; r.den = den; return r; } };