On Fri, Nov 16, 2012 at 9:50 AM, botp <botpena / gmail.com> wrote:
> try a chain, eg,
>
> $ cat test.rb ; echo "--output--"; ruby test.rb
> [
>     [->{true},->{p "one"}],
>     [->{1==1}, ->{p "two"}],
>     [->{false},->{p "no see"}],
>     [->{true},->{p "wont see light"}],
> ].each do |condition, func|
>     break unless condition.call
>     func.call
> end
>
> --output--
> "one"
> "two"
>
> best regards -botp
>

That, right there, is idiomatic ruby.