diff --git a/java/src/json/ext/Parser.java b/java/src/json/ext/Parser.java index ef283932..7c50bf27 100644 --- a/java/src/json/ext/Parser.java +++ b/java/src/json/ext/Parser.java @@ -1195,7 +1195,7 @@ IRubyObject createCustomDecimal(int p, int new_p) { Ruby runtime = getRuntime(); ByteList num = absSubSequence(p, new_p); IRubyObject numString = runtime.newString(num.toString()); - return parser.decimalClass.callMethod(context, "new", numString); + return runtime.getKernel().callMethod(context, "BigDecimal", numString); } diff --git a/java/src/json/ext/Parser.rl b/java/src/json/ext/Parser.rl index f670bad1..ae01e7ad 100644 --- a/java/src/json/ext/Parser.rl +++ b/java/src/json/ext/Parser.rl @@ -567,7 +567,7 @@ public class Parser extends RubyObject { Ruby runtime = getRuntime(); ByteList num = absSubSequence(p, new_p); IRubyObject numString = runtime.newString(num.toString()); - return parser.decimalClass.callMethod(context, "new", numString); + return runtime.getKernel().callMethod(context, "BigDecimal", numString); } %%{