From: Julian Leviston Date: 2008-04-11T09:21:32+09:00 Subject: Re: Stack Level Too Deep? Or maybe super()? Julian Learn Ruby on Rails! Check out the FREE VIDS (for a limited time) VIDEO #3 out NOW! http://sensei.zenunit.com/ On 11/04/2008, at 10:10 AM, Ken Bloom wrote: > On Thu, 10 Apr 2008 18:00:15 -0500, Ryan Lewis wrote: > >> I have a User class that handles users as structs and adds them to a >> hash within the class. Anyways, I was making a Remove functions for >> it. >> Here's my code: >> >> [code] >> class User < Struct.new(:username, :password) > >> def remove() >> self.remove() ### => Stack Level Too Deep. >> end >> end > > The remove() method just keeps calling itself. I think you wanted > def remove() > self.class.remove(self.username) > end > > --Ken > > > -- > Ken (Chanoch) Bloom. PhD candidate. Linguistic Cognition Laboratory. > Department of Computer Science. Illinois Institute of Technology. > http://www.iit.edu/~kbloom1/ >