Looking things up in a hash is concise, readable and fun.
Finding items in an array is not that much fun.
We can have our delicious Hash
lookup notation, for any type of lookup we want with a little proc
trickery.
Ruby’s proc
s support the []
notation for their invocation (prc[]). Using that knowledge we can present any complex lookup with our syntactic sugar.