Ruby lambda in a different scope

When you create a ruby lambda it is bound the the scope it was defined in. Therefore, if you create it in the class scope, you cannot access instance variables or protected instance methods.

To execute the lambda in your instance’s scope, use the instance_eval method: