mirror of
https://github.com/jimeh/redistat.git
synced 2026-02-19 13:26:39 +00:00
renamed methods internally in Redistat::Date
This commit is contained in:
@@ -23,19 +23,19 @@ module Redistat
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def to_time
|
def to_t
|
||||||
::Time.local(@year, @month, @day, @hour, @min, @sec, @usec)
|
::Time.local(@year, @month, @day, @hour, @min, @sec, @usec)
|
||||||
end
|
end
|
||||||
|
|
||||||
def to_date
|
def to_d
|
||||||
::Date.civil(@year, @month, @day)
|
::Date.civil(@year, @month, @day)
|
||||||
end
|
end
|
||||||
|
|
||||||
def to_integer
|
def to_i
|
||||||
to_time.to_i
|
to_time.to_i
|
||||||
end
|
end
|
||||||
|
|
||||||
def to_string(depth = nil)
|
def to_s(depth = nil)
|
||||||
depth ||= :sec
|
depth ||= :sec
|
||||||
output = ""
|
output = ""
|
||||||
DEPTHS.each_with_index do |current, i|
|
DEPTHS.each_with_index do |current, i|
|
||||||
@@ -50,10 +50,10 @@ module Redistat
|
|||||||
output
|
output
|
||||||
end
|
end
|
||||||
|
|
||||||
alias :to_t :to_time
|
alias :to_time :to_t
|
||||||
alias :to_d :to_date
|
alias :to_date :to_d
|
||||||
alias :to_i :to_integer
|
alias :to_integer :to_i
|
||||||
alias :to_s :to_string
|
alias :to_string :to_s
|
||||||
|
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|||||||
Reference in New Issue
Block a user