From: Pito Salas Date: 2009-02-13T07:24:59+09:00 Subject: Better way to do this? Hi, I seem to be repeating myself in the following little bit: if (!@options[:namespace].nil?) namespace_options = @options[:namespace] root.add_namespace(namespace_options[:namespace], namespace_options[:value]) end Can someone show me a way to not repeat options[:namespace] ? Simpler example of the exact same: if (!hash[:value].nil?) h = hash[:value] puts h[:left], h[:right] end Thanks for any tips for writing more idiomatic ruby! -- Posted via http://www.ruby-forum.com/.