日付の配列がある時に

pry(main)> dates = (1..10).map{|i| Date.new(2015,i) }
=> [Thu, 01 Jan 2015, Sun, 01 Feb 2015, Sun, 01 Mar 2015, Wed, 01 Apr 2015, Fri, 01 May 2015, Mon, 01 Jun 2015, Wed, 01 Jul 2015, Sat, 01 Aug 2015, Tue, 01 Sep 2015, Thu, 01 Oct 2015]

現在の日付よりも新しく、かつ一番近い日付を選択したい時の処理

pry(main)> Date.today
=> Fri, 13 Feb 2015
pry(main)> dates.find{|date| date > Date.today}
=> Sun, 01 Mar 2015

findメソッドはやっぱり便利!