Created
September 1, 2015 10:08
-
-
Save yemartin/54db7476aa41b85e7eb8 to your computer and use it in GitHub Desktop.
Where is Waldo?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'active_support/all' | |
@store = ActiveSupport::HashWithIndifferentAccess.new | |
def my_hash | |
@store[:foo] ||= {bar: 'BAR'} | |
end | |
my_hash[:waldo] = 'WALDO' | |
my_hash[:baz] = 'BAZ' | |
my_hash[:qux] = 'QUX' | |
puts my_hash |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The answer was given by Matt Jones on the rubyonrails-core mailing list:
https://groups.google.com/d/msg/rubyonrails-core/SvRAIOu-hoU/4rXrXubUHQAJ