Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Allow the RubyClass to be determined when extending BigDecimal #199

Closed
wants to merge 1 commit into from

2 participants

@headius
Owner

This might be an ok interim fix, but I'd rather wait until we can correct the BigDecimal construction sequence as described in #198.

@headius headius closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 1 deletion.
  1. +6 −1 src/org/jruby/ext/bigdecimal/RubyBigDecimal.java
View
7 src/org/jruby/ext/bigdecimal/RubyBigDecimal.java
@@ -152,6 +152,11 @@ public RubyBigDecimal(Ruby runtime, RubyClass klass) {
super(runtime, klass);
}
+ public RubyBigDecimal(Ruby runtime, RubyClass klass, BigDecimal value) {
+ super(runtime, klass);
+ this.value = value;
+ }
+
public RubyBigDecimal(Ruby runtime, BigDecimal value) {
super(runtime, runtime.getClass("BigDecimal"));
this.value = value;
@@ -482,7 +487,7 @@ public static RubyBigDecimal newInstance(IRubyObject recv, IRubyObject[] args) {
}
}
}
- return new RubyBigDecimal(runtime, decimal);
+ return new RubyBigDecimal(runtime, (RubyClass)recv, decimal);
}
private static RubyBigDecimal newZero(Ruby runtime, int sign) {
Something went wrong with that request. Please try again.