From: Yukihiro Matsumoto Date: 2010-08-27T16:24:27+09:00 Subject: Re: how about Array#collect_until Hi, In message "Re: how about Array#collect_until" on Fri, 27 Aug 2010 15:32:29 +0900, timr writes: |[1,2,3].collect{|item| item + 10} # => [11,12,13] |[1,2,3].collect_until({|x| x%2 == 0}) {|item| item + 10} # => [11,12] How about using [1,2,3].take_while{|x| x%2 != 0}.collect{|item| item + 10} ? Ah, collect_until seems inclusive, but I think it shouldn't. matz.