So I have some codes look like the following:
@foo ||= {}
@foo[:bar] ||= {}
@foo[:bar][:baz] ||= {}
I am not concerning the performance, but the cleanness. Is there a more beautiful way or better way to do so?
{:bar => {:baz => {}}}.merge(@foo)