Previously, I asked about a clever way to execute a method on a given condition \"Ruby a clever way to execute a function on a condition.\"
The solutions and respons
that code doesn't work. it executes a
at the time it is added to the hash, not when it is retrieved from the hash (try it in irb).
It doesn't work in the class because there is no a
method defined on the class (you eventually define a method a
on the instance.
Try actually using lambdas like
{0 => lambda { puts "hello world" }}
instead