Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BigDecimal.new() -> BigDecimal() for Ruby 2.7 (BigDecimal 2) #47

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/edn.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,12 @@ def self.set(*elems)
Set.new(*elems)
end

def self.rational(value)
Rational(value)
end

def self.big_decimal(str)
BigDecimal.new(str)
BigDecimal(str)
end
end

Expand Down
6 changes: 3 additions & 3 deletions lib/edn/core_ext.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ def allows_metadata?
end
end

module Bignum
module Integer
def to_edn
self.to_s + 'M'
self.to_s + 'N'
end
end

Expand Down Expand Up @@ -94,7 +94,7 @@ def to_edn
end

Numeric.send(:include, EDN::CoreExt::Unquoted)
Bignum.send(:include, EDN::CoreExt::Bignum)
Integer.send(:include, EDN::CoreExt::Integer)
BigDecimal.send(:include, EDN::CoreExt::BigDecimal)
TrueClass.send(:include, EDN::CoreExt::Unquoted)
FalseClass.send(:include, EDN::CoreExt::Unquoted)
Expand Down
2 changes: 1 addition & 1 deletion lib/edn/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module EDN
VERSION = "1.1.1"
VERSION = "1.1.2"
end