[MacRuby-devel] Re: super_foo style RubyCocoa messages.

Eloy Duran eloy.de.enige at gmail.com
Sun May 4 10:22:24 PDT 2008


Oh and the current code, not much, is available at:
http://github.com/alloy/macruby_rubycocoa_layer/tree/master

On 4 mei 2008, at 19:20, Eloy Duran wrote:

> I've started work on a RubyCocoa layer for MacRuby (still very naive).
>
> Like already discussed with Laurent, an API to be able to call the  
> superclass implementation of a method
> will be necessary for super_foo style methods to work. Imagine this  
> code:
>
> class Foo < OSX::NSObject
>  def init
>    self if super_init
>  end
> end
>
> Something like this will be needed:
>
> class OSX::NSObject
>  def method_missing(mname, *args, &block)
>    if superclass_method?(mname)
>      # convert mname to selector
>      super_send(selector, *args) # <- #super_send (or something like  
> it) should be able to send a message to the superclasses  
> implementation.
>    else
>      original_method_missing(mname, *args, &block)
>    end
>  end
> end
>
> I hope this is clear enough?
>
> Cheers,
> Eloy



More information about the MacRuby-devel mailing list