Forum: Ruby Re: A more elegant way to do this?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
1c1e3bdfe006a22214102fcd6434a012?d=identicon&s=25 Daniel Sheppard (Guest)
on 2006-05-11 08:37
(Received via mailing list)
>          }
>       end #Unless
>     }
>   end #unless

use (value||[]), ie:

    (conf['hosts'][hostname]['groups']||[]).each { |group|
          (conf['crontables'][group]||[]).each { | tab_item|
            tab_entries << tab_item
C0cb3aadb9a66d00df16686f4a1fc312?d=identicon&s=25 Tim Uckun (Guest)
on 2006-05-11 12:17
(Received via mailing list)
Thanks for all your replies.  I knew there was a better way, I kept
reading and thinking that I am still not thinking in ruby.
This topic is locked and can not be replied to.