mirror of
https://github.com/jimeh/time_ext.git
synced 2026-02-19 05:16:40 +00:00
added description to Time#round
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user