From: Edward Faulkner Date: 2005-12-09T02:00:25+09:00 Subject: Re: ruby newby --5vNYLRcllDrimb99 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Dec 09, 2005 at 01:32:35AM +0900, Uwe Schmitt wrote: > methods = { :FIND_START => self.find_start, > :SCAN_HEADER => self.scan_header > } This doesn't do what you want. It's trying to call the "find_start" and "scan_header" methods on the Parser Class object. There are several possibilities to do this correctly: 1. Call self.instance_method(:find_start) to get an unbound method, which you'll need to #bind before calling it. 2. Construct your "methods" table in #initialize, and use self.method(:find_start) to get a bound method. 3. Don't build a method table at all. Do this instead: def scan(line) self.send(@state,line) end regards, Ed --5vNYLRcllDrimb99 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQFDmGZtnhUz11p9MSARAqDcAKCyT2XHR1ZKaI4mmuSEHqX2M8x5JgCgyAkq H5yykrQpu0ECy9hPAFgfEMY= =gsdK -----END PGP SIGNATURE----- --5vNYLRcllDrimb99--