Numeric#{upto,downto}: limit may not be an integer

This commit is contained in:
Yukihiro Matsumoto
2012-09-15 14:48:31 +09:00
parent f0f113ef0e
commit 4de0a2afbf
-2
View File
@@ -10,7 +10,6 @@ class Integer
#
# ISO 15.2.8.3.15
def downto(num, &block)
raise TypeError, "expected Integer" unless num.kind_of? Integer
i = self
while(i >= num)
block.call(i)
@@ -38,7 +37,6 @@ class Integer
#
# ISO 15.2.8.3.27
def upto(num, &block)
raise TypeError, "expected Integer" unless num.kind_of? Integer
i = self
while(i <= num)
block.call(i)