示例#1
0
 // 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;
 }
示例#2
0
 // c: random_state
 @JRubyMethod(name = "state", visibility = PRIVATE)
 public IRubyObject stateObj(ThreadContext context) {
   return random.getState();
 }