mirror of
https://github.com/jimeh/redistat.git
synced 2026-02-19 13:26:39 +00:00
added to_t and to_d method aliases to
Redistat::Date for the to_time and to_date methods respectively
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user