public void marshalTo(Ruby runtime, Object obj, RubyClass type, MarshalStream marshalStream) throws IOException { RubySystemCallError exc = (RubySystemCallError) obj; marshalStream.registerLinkTarget(exc); List<Variable<Object>> attrs = exc.getVariableList(); attrs.add( new VariableEntry<Object>( "mesg", exc.message == null ? runtime.getNil() : exc.message)); attrs.add(new VariableEntry<Object>("errno", exc.errno)); attrs.add(new VariableEntry<Object>("bt", exc.getBacktrace())); marshalStream.dumpVariables(attrs); }
public void marshalTo(Ruby runtime, Object obj, RubyClass type, MarshalStream marshalStream) throws IOException { RubyRange range = (RubyRange) obj; marshalStream.registerLinkTarget(range); List<Variable<IRubyObject>> attrs = range.getVariableList(); attrs.add(new VariableEntry<IRubyObject>("begin", range.begin)); attrs.add(new VariableEntry<IRubyObject>("end", range.end)); attrs.add( new VariableEntry<IRubyObject>( "excl", range.isExclusive ? runtime.getTrue() : runtime.getFalse())); marshalStream.dumpVariables(attrs); }