ruby Rational Date and DateTime

If you subtract two Date or DateTime objects, the result is a Rational representing the number of days between them. What you need is:

a = Date.new(2009, 10, 13) - Date.new(2009, 10, 11)
(a * 24 * 60).to_i   # 2880 minutes

or

a = DateTime.new(2009, 10, 13, 12, 0, 0) - DateTime.new(2009, 10, 11, 0, 0, 0)
(a * 24 * 60).to_i   # 3600 minutes