From: Fabian Senftenberg Date: 2001-12-11T18:02:45+09:00 Subject: [ruby-talk:28189] Re: Ensuring a specific type Paul Brannan writes: >> class Interval >> @start = Time.new() >> @duration = 0 > > This is not correct. You should not initialize instance variables here. > >> def initialize(s, d = 0) >> @start = s >> @duration = d > > Instead, you should initialize them here. Well, that makes my point (or question) even stronger. How do I ensure that @start and @duration are of type Time in order to allow the following: >> def end() >> return #{@start + @duration}.usec >> end ? -- senf