method
take_while
![Some documentation Importance_1](https://d2vfyqvduarcvs.cloudfront.net/images/importance_1.png?1349367920)
take_while()
public
Passes elements to the block until the block returns nil or false, then stops iterating and returns an array of all prior elements.
If no block is given, an enumerator is returned instead.
a = [1, 2, 3, 4, 5, 0] a.take_while {|i| i < 3 } #=> [1, 2]