# Re: Fuzzy Time (#99)

**URL:** <https://www.ruby-forum.com/t/re-fuzzy-time-99/74522>\
**Category:** Ruby\
**Created:** [November 7, 2006, 10:47am UTC](https://www.ruby-forum.com/t/re-fuzzy-time-99/74522 "2006-11-07T10:47:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![phrogz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/2acd7d/32.png) [@phrogz](https://www.ruby-forum.com/u/phrogz)\
**Post date:** [November 7, 2006, 10:47am UTC](https://www.ruby-forum.com/t/re-fuzzy-time-99/74522/1 "2006-11-07T10:47:00Z")

</div>

From: Robert Conn [[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)]

> Gavin - I was able to test the code with your test class. I don’t  
> claim to fully understand it yet though.

Sorry about that…I wrote it for my own use (no comments, terrible  
variable names) and then on a whim decided to post it in case someone  
found it helpful.

> As a sidenote, I assume Ruby doesn’t support overloaded methods? I  
> initially tried to implement initialize with 2 methods, one with no  
> parameters, one with the time parameter but it didn’t work.

Not as such, but you can provide default values (which may involve  
calculations, not just constants) for arguments. For example:

class FuzzyTime  
def initialize( start\_time = Time.new )  
p start\_time  
end  
end

FuzzyTime.new  
#=\> Mon Oct 30 15:28:13 -0700 2006

FuzzyTime.new( Time.at( 0 ) )  
#=\> Wed Dec 31 17:00:00 -0700 1969
