--- Michael Schuerig <schuerig / acm.org> wrote:
> Michael Neumann <neumann / s-direktnet.de> wrote:
> 
> > Michael Schuerig wrote:
> > > 
> > > Ruby has an XML-RPC package and KDE has the
> XmlRpc Daemon. See
> > >
>
<http://www.s-direktnet.de/homepages/neumann/xmlrpc4r/index.html>
> > > and
> <http://developer.kde.org/kde2arch/xmlrpc.html>.
> 
> 
> > Try following piece of code:
> > 
> >       require "xmlrpc/client"
> >       port, auth = File.readlines(ENV['HOME'] +
> '/.kxmlrpcd').to_s.split(',')
> >       server = XMLRPC::Client.new("localhost",
> "/kdesktop", port)
> >       begin
> >        
> server.call("KDesktopIface.popupExecuteCommand",
> auth)
> >       rescue XMLRPC::FaultException => e
> >         p "Error: ", e.faultCode, e.faultString
> >       end
> > 
> > I have not tested it, but it should work.
> 
> Thanks, it does.
> 
> The Python code has the nice feature, that remote
> calls look as if they
> were instance methods of the client class:
> 
> >     server = Server("http://localhost:" + port
> +"/kdesktop")
> >    
> server.KDesktopIface.popupExecuteCommand(auth);
> 
> Could something like that be done in Ruby? Possibly
> with the help of
> method_missing?

Might look something like (untested) this:
def XMLRPC::Client
 def method_missing(sym, *args)
      return call(sym.id2name, args)
  end
end

__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/