From: Dan Date: 2007-08-04T23:20:05+09:00 Subject: Re: Better way to do this? Currently using two method_missing calls... Ok, I see where you were going now. I guess I could go in that direction, but since sending functions and objects to the web service is just done via POST params, so I'd rather route all the requests to the "call" class method on my API class. Any ideas on how to do this without having to create a instance of the API class (or any class) just to store the "object" name ? Dan On Aug 4, 9:27 am, Xavier Noria wrote: > El Aug 4, 2007, a las 1:29 PM, Dan escribi�: > > > Thanks for the reply. I'm probably being dense here, but I don't see > > how Delegator would help in this scenario. Can you explain what you > > mean? > > I guess the one being dense was me then :-). > > You are dispatching everything to some object dynamically. That's > what the delegator library is made for and that's why it rang a bell > when you asked for alternatives to that implementation. It is just an > idea for you to see whether it is worthwile compared to your approach. > > According to the code there are two levels of catchall: The first one > is a class-level catchall, it creates a new object out of something > like API.images. The second one dispatches to that object somehow. > Delegation would target the former so the class-level method_missing > would return an object that already has delegation builtin. > > Without seeing the real intented usage I can't be more specific. It > could be that the way to call the remote service only uses symbols > and there's no real object locally. If that was the case the > delegator library wouldn't fit. > > -- fxn