From 42f154f1a7cd250a670830676e393b9932cfd35b Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Mon, 19 Jul 2010 10:45:46 +0300 Subject: [PATCH] added to_t and to_d method aliases to Redistat::Date for the to_time and to_date methods respectively --- lib/redistat/date.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/redistat/date.rb b/lib/redistat/date.rb index a5ea99f..ebfa6f0 100644 --- a/lib/redistat/date.rb +++ b/lib/redistat/date.rb @@ -45,7 +45,7 @@ module Redistat from_time(::Time.parse(input)) end - def to_s(depth = :sec) + def to_string(depth = :sec) output = "" [:year, :month, :day, :hour, :min, :sec].each_with_index do |current, i| break if self.send(current).nil? @@ -55,7 +55,9 @@ module Redistat output end - alias :to_string :to_s + alias :to_s :to_string + alias :to_t :to_time + alias :to_d :to_date end end