If it looks like a duck, and quacks like a duck…
Why we don’t need to write:
case x
when A_class...
when Another_class...
end
see: http://www.rubygarden.org/ruby?DuckTyping
Ruby objects aren’t strictly typed. It has more to do with the capabilities of an object rather than a fixed type. With mixins and re-openable classes then the notion of a single class becomes even less useful.
category: Glossary