Sha256: 39e28c900412e36e006f7944192791310f534a28646ab6b47f193a812e10a721
Contents?: true
Size: 236 Bytes
Versions: 15
Compression:
Stored size: 236 Bytes
Contents
require 'facets/time/trunc' class Time # Round time at the nearest range (in seconds). # # t = Time.now # => # t.round(60*60) # 1 hour # => # def round(amount) (self+amount/2.0).trunc(amount) end end
Version data entries
15 entries across 15 versions & 2 rubygems