@@ -139,8 +139,8 @@ public static IRubyObject from_state(ThreadContext context,
139139 }
140140
141141 @ JRubyMethod (meta =true )
142- public static IRubyObject generate (ThreadContext context , IRubyObject klass , IRubyObject obj , IRubyObject opts ) {
143- return fromState (context , opts ).generate (context , obj );
142+ public static IRubyObject generate (ThreadContext context , IRubyObject klass , IRubyObject obj , IRubyObject opts , IRubyObject io ) {
143+ return fromState (context , opts )._generate (context , obj , io );
144144 }
145145
146146 static GeneratorState fromState (ThreadContext context , IRubyObject opts ) {
@@ -196,7 +196,7 @@ static GeneratorState fromState(ThreadContext context, RuntimeInfo info,
196196 */
197197 @ JRubyMethod (optional =1 , visibility =Visibility .PRIVATE )
198198 public IRubyObject initialize (ThreadContext context , IRubyObject [] args ) {
199- configure (context , args .length > 0 ? args [0 ] : null );
199+ _configure (context , args .length > 0 ? args [0 ] : null );
200200 return this ;
201201 }
202202
@@ -228,9 +228,9 @@ public IRubyObject initialize_copy(ThreadContext context, IRubyObject vOrig) {
228228 * the result. If no valid JSON document can be created this method raises
229229 * a GeneratorError exception.
230230 */
231- @ JRubyMethod
232- public IRubyObject generate (ThreadContext context , IRubyObject obj ) {
233- IRubyObject result = Generator .generateJson (context , obj , this );
231+ @ JRubyMethod ( visibility = Visibility . PRIVATE )
232+ public IRubyObject _generate (ThreadContext context , IRubyObject obj , IRubyObject io ) {
233+ IRubyObject result = Generator .generateJson (context , obj , this , io );
234234 RuntimeInfo info = RuntimeInfo .forRuntime (context .getRuntime ());
235235 if (!(result instanceof RubyString )) {
236236 return result ;
@@ -411,7 +411,7 @@ public boolean strict() {
411411 return strict ;
412412 }
413413
414- @ JRubyMethod (name ="strict" )
414+ @ JRubyMethod (name ={ "strict" , "strict?" } )
415415 public RubyBoolean strict_get (ThreadContext context ) {
416416 return context .getRuntime ().newBoolean (strict );
417417 }
@@ -484,8 +484,8 @@ private ByteList prepareByteList(ThreadContext context, IRubyObject value) {
484484 * @param vOpts The options hash
485485 * @return The receiver
486486 */
487- @ JRubyMethod (alias = "merge" )
488- public IRubyObject configure (ThreadContext context , IRubyObject vOpts ) {
487+ @ JRubyMethod (visibility = Visibility . PRIVATE )
488+ public IRubyObject _configure (ThreadContext context , IRubyObject vOpts ) {
489489 OptionsReader opts = new OptionsReader (context , vOpts );
490490
491491 ByteList indent = opts .getString ("indent" );
0 commit comments