Sha256: facdd1ef679da7ecdb9948755998c01e4e48f2d8e4ad1664219d0aab03fa0ba9

Contents?: true

Size: 929 Bytes

Versions: 1

Compression:

Stored size: 929 Bytes

Contents

# 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

``` ruby
# 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

1. Fork it ( http://github.com/<my-github-username>/cachew/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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cachew-0.1.0 README.md