Cachew
Simple (and unified) cache interface.
Installation
Add this line to your application's Gemfile:
gem 'cachew'
And then execute:
$ bundle
Or install it yourself as:
$ gem install cachew
Usage
# With HashAdapter
cache = Cachew.new({})
cache.has?(:foo) # => false
cache.fetch(:foo) { :bar } # => :bar
cache.has?(:foo) # => true
cache.fetch(:foo) { :moo } # => :bar
# With (default) NullAdapter
cache = Cachew.new
cache.has?(:foo) # => false
cache.fetch(:foo) { :bar } # => :bar
cache.has?(:foo) # => false
cache.fetch(:foo) { :moo } # => :moo
Contributing
- Fork it ( http://github.com/
/cachew/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



