(extrait d'un slide de presentation de ruby aux développeurs Java)

Item #5 Don’t Worry About Interfaces

Ruby Uses Duck Typing

   * If it walks like a duck,
   * And talks like a duck,
         o Then we can treat it like a duck.
         o (who cares what it really is)

class Duck

 def talk() puts "Quack" end

end class DuckLikeObject

 def talk() puts "Kwak" end

end flock = [

 Duck.new,
 DuckLikeObject.new ]

flock.each do |d| d.talk end

No need to inherit from a common interface.

C'est définitivement sexy. :)