summaryrefslogtreecommitdiffhomepage
path: root/mrblib
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2013-10-21 07:42:50 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2013-10-21 07:42:50 +0900
commit3ae0616710b10b091baa130f85a56b5ef2c66633 (patch)
treebac5db924b04c17d12cc28f13559d8da4c6ad243 /mrblib
parent9cb58a2252d25f81346ae3d4eefb1775d9ed548b (diff)
downloadmruby-3ae0616710b10b091baa130f85a56b5ef2c66633.tar.gz
mruby-3ae0616710b10b091baa130f85a56b5ef2c66633.zip
implement Integer#succ in Ruby
Diffstat (limited to 'mrblib')
-rw-r--r--mrblib/numeric.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/mrblib/numeric.rb b/mrblib/numeric.rb
index daa35c5d6..a5aa3e451 100644
--- a/mrblib/numeric.rb
+++ b/mrblib/numeric.rb
@@ -35,6 +35,16 @@ class Integer
end
##
+ # Returns self + 1
+ #
+ # ISO 15.2.8.3.19
+ def next
+ self + 1
+ end
+ # ISO 15.2.8.3.21
+ alias succ next
+
+ ##
# Calls the given block +self+ times.
#
# ISO 15.2.8.3.22