README.md in object-cache-0.0.5 vs README.md in object-cache-0.1.0
- old
+ new
@@ -155,11 +155,12 @@
```
This allows you to selectively purge keys from Redis:
```ruby
-Cache.backend.del('hello_')
+keys = Cache.backend.keys('hello_*')
+Cache.backend.del(keys)
```
You can also use the special value `:method_name` to dynamically set the key
prefix based on where the cached object was created:
@@ -207,27 +208,18 @@
The above example obviously only works if the replicas receive the written data
from the primary instance.
#### core extension
-Finally, if you want, you can extend `Object` with a `cache` method, for
-convenient access to the cache object:
+Finally, if you want, you can use the `cache` method, for convenient
+access to the cache object:
```ruby
require 'object/cache/core_extension'
# these are the same:
cache('hello', ttl: 60) { 'hello world' }
Cache.new('hello', ttl: 60) { 'hello world' }
-```
-
-You can also call this method directly on any instances inheriting from
-`Object`:
-
-```ruby
-require 'object/cache/core_extension'
-
-'hello world'.cache(ttl: 60)
```
That's it!
## License