From: Marcus C. <cra...@re...> - 2007-12-09 01:47:24
|
Hi All, Hope all is going well! I'm trying to extend method_missing on OSX::CIImage using =20 alias_method_chain and are having trouble getting it to work, here's =20 an example to demonstrate it: require 'rubygems' require 'active_support' require 'osx/cocoa' module OSX class CIImage def method_missing_with_example(sym, *args, &block) method_missing_without_example(sym, *args, &block) end alias_method_chain :method_missing, :example end end original =3D =20 OSX::CIImage.imageWithContentsOfURL(OSX::NSURL.fileURLWithPath('/Users/=20= crafterm/Desktop/leaves_desktop.jpg')) puts original.extent.size When I run this I get: NoMethodError: undefined method =91extent=92 for = #<OSX::CIConcreteImage:=20 0x117248c> If I comment out the call to alias_method_chain I get the expected =20 result: #<OSX::CGSize:0x1173710> Somehow alias_method_chain breaks it. This is using Ruby & RubyCocoa =20 as per a default install of Leopard, Rails 2.0.1 active support gems. Any thoughts what might be going on or what I could try to get it =20 working? Cheers, Marcus= |