This is a compilation of design pattern sample implementations, initially on ruby and java.
The language choice was based on the need to show differences of implementation on very different languages.
So Java was chosen for representing statically typed and compiled languages and ruby for showing the aspects of dynamic typed and interpreted languages.
This is the first example to be written, based on the almost canonical case of a Rectangle and a Square. The benefit of implementing a Square class by composing a Rectangle class instance instead of inheriting from it is shown on both languages. One of the most clear differences is the use of an interface in Java, concept and keyword that does not exist on Ruby, however the same interface(methods available) is implemented in both cases.