Hola,

Objective-C has categories. They allow you to extend a class like this:

 @interface NSArray (ArrayAdditions)
  - (void) randomize;
 @end

 @implementation NSArray (ArrayAdditions)
  - (void) randomize {
    ... this executes as if it is a method of NSArray ...
  }
 @end

This example adds a randomize method to the existing NSArray class.

The Category is active the moment it is loaded into the runtime.

Is this also possible in Ruby? I know about Class.extend and Mixins, but what I
am looking for is the auto-loading.

 S.