Ruby 1.9 Broken Enumerable

Dec 01, 2023

Lambdas can be used to make code clearer.

Example:

toll_free = -> num { num.start_with?(‘800’, ‘888’, ‘877’, ‘866’) }
[“5143334444”, “8883334444”].select(&toll_free)