Best way to store 'global variable' hash?

You could create a simple object (somewhere in yer /lib) that contains all of the hard-coded configuration values and cache it using the built in memory cache of rails:

Rails.cache.write(‘key’, myobj)

The object can then be retrieved using:

Rails.cache.read(‘key’)

The default cache store, ActiveSupport::Cache::MemoryStore, is not shared between rails server processes so the object will be cached in memory for each instance of rails you have running. This probably isn’t that big of an issue, if but you want to change your caching strategy you can modify the config.cache_store to tell rails to use a different type of caching. Apparently not all types of caching support object caching, but MemoryStore does.

``