lib/rhcf/timeseries/redis.rb in rhcf-timeseries-0.0.2 vs lib/rhcf/timeseries/redis.rb in rhcf-timeseries-0.0.3

- old
+ new

@@ -1,7 +1,41 @@ -require 'active_support/core_ext/numeric/time' +#require 'active_support/core_ext/numeric/time' + require 'micon' require 'date' + +class Fixnum + def minutes + self * 60 + end + + def hours + self.minutes * 60 + end + + def days + self.hours * 24 + end + + def seconds + self + end + + def weeks + self.days * 7 + end + + def years + self.days * 365 + end + + alias_method :day, :days + alias_method :week, :weeks + alias_method :hour, :hours + alias_method :second, :seconds + alias_method :minute, :minutes + alias_method :year, :years +end module Rhcf module Timeseries class Result