From: "Morris, Chris" Date: 2001-10-30T05:08:40+09:00 Subject: [ruby-talk:23746] RE: win32ole glitch? > irb(main):002:0> require 'win32ole' > true > irb(main):003:0> ie = WIN32OLE.new('InternetExplorer.Application') > # > irb(main):004:0> ie.method('gohome').call > NameError: undefined method `gohome' for class `WIN32OLE' > (irb):4:in `method' > (irb):4:in `irb_binding' A-ha. The problem is not within win32ole but with the method('gohome') call. From pickaxe (p 360) Object#method: "Looks up the named method as a receiver in obj, returning a Method object (or raising NameError)." So, method_missing doesn't come into play here at all, it's faithfully doing what I asked it to do (dern computers...), find gohome in WIN32OLE, which ain't there. Since I haven't actually called the gohome method against WIN32OLE, it can't get forwarded in via method_missing. In my context, I'm coming from a string and needing a method, so the following works well: irb(main):001:0> require 'win32ole' true irb(main):002:0> ie = WIN32OLE.new('InternetExplorer.Application') # irb(main):003:0> method = 'gohome'.intern :gohome irb(main):004:0> ie.send(method) nil Chris