From: david karapetyan Date: 2007-08-19T13:12:53+09:00 Subject: Re: Ruby's equivalent to Java's "interface" ------=_Part_115128_1255172.1187496778827 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Ruby modules also allow implementation details and I'm not sure if this is also true for java interfaces. On 8/18/07, Deepak Vohra wrote: > > 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. ------=_Part_115128_1255172.1187496778827--