Guest User

Untitled

a guest
Feb 20th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. diff --git a/kernel/common/enumerable.rb b/kernel/common/enumerable.rb
  2. index 9fb2f34..8a4008f 100644
  3. --- a/kernel/common/enumerable.rb
  4. +++ b/kernel/common/enumerable.rb
  5. @@ -457,9 +457,11 @@ module Enumerable
  6. # %w[ant bear cat].all? { |word| word.length >= 4} #=> false
  7. # [ nil, true, 99 ].all? #=> false
  8.  
  9. - def all?(&prc)
  10. - prc = Proc.new { |obj| obj } unless block_given?
  11. - each { |o| return false unless prc.call(o) }
  12. + def all?
  13. + each do |o|
  14. + ret = yield(o)
  15. + return false unless ret
  16. + end
  17. true
  18. end
Add Comment
Please, Sign In to add comment