Module: Enumerable

Defined in:
lib/impl.rb

Instance Method Summary collapse

Instance Method Details

#take_untilObject



2
3
4
5
6
7
8
9
# File 'lib/impl.rb', line 2

def take_until
  memo = []
  each do |x|
    memo << x
    break if yield x
  end
  memo
end