lib/tabs/resolutions/minute.rb in tabs-0.9.1 vs lib/tabs/resolutions/minute.rb in tabs-1.0.0
- old
+ new
@@ -1,13 +1,17 @@
module Tabs
module Resolutions
module Minute
- extend Tabs::Resolutionable
+ include Tabs::Resolutionable
extend self
PATTERN = "%Y-%m-%d-%H-%M"
+ def name
+ :minute
+ end
+
def serialize(timestamp)
timestamp.strftime(PATTERN)
end
def deserialize(str)
@@ -15,9 +19,13 @@
self.normalize(dt)
end
def from_seconds(s)
s / 1.minute
+ end
+
+ def to_seconds
+ 1.minute
end
def add(ts, num)
ts + num.minutes
end