Rewrite Numeric#dup and Numeric#+@ in Ruby (#11933)

This commit is contained in:
Takashi Kokubun 2024-10-22 11:01:29 -07:00 committed by GitHub
parent 9cbf2f5fff
commit 0f3723c644
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
Notes: git 2024-10-22 18:01:48 +00:00
Merged-By: k0kubun <takashikkbn@gmail.com>
3 changed files with 19 additions and 52 deletions

View file

@ -1,4 +1,14 @@
class Numeric
# call-seq:
# dup -> self
#
# Returns +self+.
#
# Related: Numeric#clone.
#
def dup
self
end
# call-seq:
# real? -> true or false
@ -70,6 +80,15 @@ class Numeric
end
alias conj conjugate
# call-seq:
# +self -> self
#
# Returns +self+.
#
def +@
self
end
end
class Integer