Skip to content

Commit 59ee5cc

Browse files
committed
Suppress Fixnum/Bignum Ruby 2.4 deprecation warnings
1 parent 36f707c commit 59ee5cc

1 file changed

Lines changed: 15 additions & 6 deletions

File tree

lib/unparser/emitter/literal/primitive.rb

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,21 @@ class Complex < self
3333

3434
RATIONAL_FORMAT = 'i'.freeze
3535

36-
MAP = IceNine.deep_freeze(
37-
Float => :float,
38-
Rational => :rational,
39-
Fixnum => :int,
40-
Bignum => :int
41-
)
36+
MAP =
37+
if 0.class.equal?(Integer)
38+
IceNine.deep_freeze(
39+
Float => :float,
40+
Rational => :rational,
41+
Integer => :int
42+
)
43+
else
44+
IceNine.deep_freeze(
45+
Float => :float,
46+
Rational => :rational,
47+
Fixnum => :int,
48+
Bignum => :int
49+
)
50+
end
4251

4352
private
4453

0 commit comments

Comments
 (0)