RES: Bare-bones Ruby

  • Thread starter Leiradella, Andre V Matos Da Cunha
  • Start date
L

Leiradella, Andre V Matos Da Cunha

Ruby does not support multiple inheritance but provides a very neat
way to reuse code: modules. Declaring a module and including it
automatically makes all the methods available in your classes.

I actually need something similar to Java interfaces, so for example if
someone wants to make his/her object "previewable" inside Moray's preview
windows he/she will have to implement the interface Previewable, and by
doing that he/she will have to implement the method preview that will be
called to construct the object's wire frame.

Multiple inheritance will work for me too, I can raise an exception in
method preview of class Previewable telling the user that this method must
be overridden, but I'd prefer to use interfaces.

I'm also looking at Pike and Ferite, the later have something called
protocol which is, as far as I can tell, exactly the same as Java
interfaces. I'll let you guys know when I make my choice .

Thank you for the info.

Andre de Leiradella
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top