added description to Time#round

This commit is contained in:
2010-07-27 20:06:31 +03:00
parent 43ff6db449
commit 7b8cc60ae3

View File

@@ -24,6 +24,7 @@ class Time
alias :beginning_of_next :ceil
alias :at_beginning_of_next :ceil
# Returns a new Time representing the start of the current or next unit specified (second by default) depending which is closest
def round(unit = :sec)
next_unit = self.ceil(unit)
this_unit = self.floor(unit)