2012-04-29 Array#detect調べた Ruby ブロック内で最初にtrueになった要素を返す。 score = [10 , 20 , 30 , 40 ] p score.detect { | v | v > 20 } 30