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

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Daniel S. (Guest)
on 2006-05-11 10: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
          }
     }
Tim U. (Guest)
on 2006-05-11 14: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.