Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/kernel/common/enumerable.rb b/kernel/common/enumerable.rb
- index 9fb2f34..8a4008f 100644
- --- a/kernel/common/enumerable.rb
- +++ b/kernel/common/enumerable.rb
- @@ -457,9 +457,11 @@ module Enumerable
- # %w[ant bear cat].all? { |word| word.length >= 4} #=> false
- # [ nil, true, 99 ].all? #=> false
- - def all?(&prc)
- - prc = Proc.new { |obj| obj } unless block_given?
- - each { |o| return false unless prc.call(o) }
- + def all?
- + each do |o|
- + ret = yield(o)
- + return false unless ret
- + end
- true
- end
Add Comment
Please, Sign In to add comment