// c: random_dump @JRubyMethod(name = "marshal_dump") public IRubyObject marshal_dump(ThreadContext context) { RubyBignum state = random.getState(); RubyInteger left = (RubyInteger) RubyNumeric.int2fix(context.runtime, random.getLeft()); RubyArray dump = RubyArray.newArray(context.runtime, state, left, random.getSeed()); if (hasVariables()) { dump.syncVariables(this); } return dump; }
// c: random_state @JRubyMethod(name = "state", visibility = PRIVATE) public IRubyObject stateObj(ThreadContext context) { return random.getState(); }