From: Michael Garriss Date: 2003-09-12T05:50:56+09:00 Subject: Re: Passing an Object Class from a method to a caller RLMuller wrote: > Hi All, > > I can't seem to pass an Object Class from a method to a calling routine > > Here's what I wrote: > > def getTypeOf(o) > aTypes = [Array, String, Numeric, Fixnum, Struct, MatchData] > result = Object > i = 0 > for t in aTypes > i += 1 > if o.is_a?t then > result=t > print "Index = #{i.to_s}: Type = '#{t.to_s}'\n" > break > end > result > end > end Looks like your 'break' is passing the 'result' line and thus returning the result of 'print'. Michael