Skip to content
This repository has been archived by the owner on Mar 8, 2022. It is now read-only.
/ scoped_storage Public archive

Saves values in thread local or global storage with a hash like interface

License

Notifications You must be signed in to change notification settings

slowjack2k/scoped_storage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ScopedStorage Code Climate Build Status Coverage Status Gem Version

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.

Installation

Add this line to your application's Gemfile:

gem 'scoped_storage'

And then execute:

$ bundle

Or install it yourself as:

$ gem install scoped_storage

Usage

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!

Contributing

  1. Fork it ( http://github.com/slowjack2k/scoped_storage/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

About

Saves values in thread local or global storage with a hash like interface

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages