예제 #1
0
        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);
        }
예제 #2
0
        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);
        }
예제 #3
0
 public void marshalTo(MarshalStream output) throws java.io.IOException {
   output.write(isTrue() ? 'T' : 'F');
 }
예제 #4
0
파일: RubyFloat.java 프로젝트: komax/jruby
 public static void marshalTo(RubyFloat aFloat, MarshalStream output) throws java.io.IOException {
   output.registerLinkTarget(aFloat);
   output.writeString(aFloat.marshalDump());
 }