Overriding unary operators in Ruby

Posted . Visible to the public.

This must be one of the coolest, yet quite unknown, technique in Ruby. For certain types of problems (e.g. when you have a set of rules) this gives you such an elegant way of describing the solution. There’s no meta programming or monkey patching involved, it’s short and sweet and best of all: it’s very intuitive.

Last edit
Keywords
makandra, ruby
License
Source code in this card is licensed under the MIT License.
Posted by Lexy to makandra dev (2010-12-20 23:16)