Commit d8fc05fc authored by ksss's avatar ksss

Hash#{reject,reject!} support return Enumerator

parent b0f10b5c
......@@ -134,6 +134,8 @@ class Hash
# 1.8/1.9 Hash#reject! returns Hash; ISO says nothing.
def reject!(&b)
return to_enum :reject! unless block_given?
keys = []
self.each_key{|k|
v = self[k]
......@@ -150,6 +152,8 @@ class Hash
# 1.8/1.9 Hash#reject returns Hash; ISO says nothing.
def reject(&b)
return to_enum :reject unless block_given?
h = {}
self.each_key{|k|
v = self[k]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment