https://github.com/remind101/namespaced-cache
An ActiveSupport::Cache implementation for prefixing keys automatically.
https://github.com/remind101/namespaced-cache
Last synced: about 2 months ago
JSON representation
An ActiveSupport::Cache implementation for prefixing keys automatically.
- Host: GitHub
- URL: https://github.com/remind101/namespaced-cache
- Owner: remind101
- License: mit
- Created: 2014-12-03T07:57:43.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-08-17T22:36:20.000Z (almost 11 years ago)
- Last Synced: 2026-06-04T13:06:11.970Z (2 months ago)
- Language: Ruby
- Homepage:
- Size: 172 KB
- Stars: 0
- Watchers: 87
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# ActiveSupport::Cache::NamespacedStore
A simple ActiveSupport::Cache implementation that wraps another implementation to prefix/namespace keys.
## Usage
```ruby
Rails.cache.write('prefix:1', 'foo')
cache = ActiveSupport::Cache::NamespacedStore.new 'prefix:', Rails.cache
cache.read '1'
# => 'foo'
```
## Contributing
1. Fork it
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