On Fri, Nov 16, 2012 at 10:35 PM, Philip Rhoades <phil / pricom.com.au> wrote:
> if ..
>   some lines of code
>   if ..
>     some lines of code
>     if ..
>       some lines of code
>       if ..
>         some lines of code
>         if ..
>           some lines of code
> etc

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