# File lib/backports/1.8.7/enumerable/take_while.rb, line 6 def take_while return to_enum(:take_while) unless block_given? inject([]) do |array, elem| return array unless yield elem array << elem end end