Sha256: 21d521b8234138e0088cca26d6ca9ec003753313e88ce469e92e684006f24f59
Contents?: true
Size: 494 Bytes
Versions: 1
Compression:
Stored size: 494 Bytes
Contents
module Tabs module Resolutions module Minute extend Tabs::Resolutionable extend self PATTERN = "%Y-%m-%d-%H-%M" def serialize(timestamp) timestamp.strftime(PATTERN) end def deserialize(str) dt = DateTime.strptime(str, PATTERN) self.normalize(dt) end def from_seconds(s) s / 60.0 end def normalize(ts) Time.utc(ts.year, ts.month, ts.day, ts.hour, ts.min) end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
tabs-0.9.0 | lib/tabs/resolutions/minute.rb |