From: Deepak Vohra Date: 2007-08-19T06:59:41+09:00 Subject: Re: Ruby's equivalent to Java's "interface" --0-69229996-1187473967=:8041 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Steve, The Ruby equivalent of Java's interface is module. Deepak Steve Quezadas wrote: Please forgive this rather naive question, but it's a query that's difficult to search for on google. In java, you can program to interface. IE, in java, you can do: public interface QuakeBehavior { public void quack(); } public class Quack implements QuckBehavior { public void quack() { System.out.println("Quack"); } } public class Squeek implements QuackBehavior { public void quack() { System.out.println("Squeek"); } } public class MuteQuack implements QuackBehavior { public void quack() { System.out.println("<< Silence >>"); } } I am learning about Design Patterns (which is a wonderful concept), but I want to know the Ruby equivalent. - steve -- Posted via http://www.ruby-forum.com/. --------------------------------- Sick sense of humor? Visit Yahoo! TV's Comedy with an Edge to see what's on, when. --0-69229996-1187473967=:8041--