With scoped storage you can save values in a thread local or thread global storage with a hash like accessor. Different scopes can be distinguished with a scope name.
Add this line to your application's Gemfile:
gem 'scoped_storage'
And then execute:
$ bundle
Or install it yourself as:
$ gem install scoped_storage
scope_storage = ScopedStorage::ThreadGlobalStorage # or ScopedStorage::ThreadLocalStorage
scope = ScopedStorage::Scope.new('policy_infos', scope_storage)
scope['my_key'] = 'my_value'
scope.fetch('my_key'){...}
scope.clear!
- Fork it ( http://github.com/slowjack2k/scoped_storage/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request