1 2 3 4 5 6 7
class Time def round(minutes = 15) minutes *= 60 Time.at((self.to_f / minutes).round * minutes) end end