From: Curt Hibbs Date: 2005-09-16T00:19:32+09:00 Subject: Re: Get to the Point: Ruby and Rails Presentation Slides ------=_Part_13696_9647129.1126797569914 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Ruby uses the same model of method invocation as Smalltalk. Conceptually,= =20 you send a "message" to an object. The message has a name and a set of=20 parameters. Ruby attempts to find a method definition that matches the=20 signature of the message in the target object's class and each of its=20 superclasses.=20 If no matching method is found, Ruby sends a "method_missing" message to th= e=20 object instead (including the original message as a parameter). Most object= s=20 don't implement method_missing and the implementation in Ruby's root object= =20 is invoked (which output the standard error message). If the object does implement method_missing, then it gets control and can d= o=20 whatever it wants with the original message. In the case of this example, i= t=20 forwards the original message to the object it is proxying. This is a powerful feature when you are building reusable frameworks. Rails= =20 uses this to provide "virtual" implementations of its find_* methods.=20 FreeRIDE uses this to implement attributes on its Databus nodes. Hope that helped. Curt On 9/15/05, Josh Charles wrote: >=20 > On 9/14/05, John W. Long wrote: > > Comments and suggestions are welcome. We would like to present this > > again in the future, so it would be good to clarify things a little. >=20 > Excellent Presentation. The only thing I didn't quite understand was > the "method_missing" stuff. I haven't encountered that before; could > you add to that a little bit? >=20 > Josh >=20 > ------=_Part_13696_9647129.1126797569914--