From: Trans Date: 2006-03-19T10:18:48+09:00 Subject: Re: can you enable coercion between types? ara.t.howard@noaa.gov wrote: > try this: > > harp:~ > cat a.rb > class Duration > def initialize seconds > @seconds = seconds > end > def coerce other > if other.class == @seconds.class > [@seconds, other] > else > [Float(@seconds), Float(other)] > end > end > end Could you explain what this is doing? I don't get the effect. Thanks, T.