예제 #1
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);
        }