niftie-cachable 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. data/cachable.gemspec +1 -1
  2. data/lib/cachable.rb +10 -2
  3. metadata +1 -1
@@ -3,7 +3,7 @@ Gem::Specification.new do |s|
3
3
  s.homepage = 'http://github.com/niftie/cachable'
4
4
  s.author = 'Nicolas Steenlant'
5
5
  s.email = 'nicolas.steenlant@gmail.com'
6
- s.version = '0.2.0'
6
+ s.version = '0.3.0'
7
7
  s.date = '2008-11-24'
8
8
  s.summary = ''
9
9
  s.files = ['cachable.gemspec', 'lib/cachable.rb']
@@ -16,12 +16,20 @@ module Cachable
16
16
  @mutex = Mutex.new
17
17
  end
18
18
 
19
+ def fetch(key)
20
+ @store[key]
21
+ end
22
+
19
23
  def store(key, object)
20
24
  @mutex.synchronize { @store[key] = object }
21
25
  end
22
26
 
23
- def fetch(key)
24
- @store[key]
27
+ def clear
28
+ @mutex.synchronize { @store.clear }
29
+ end
30
+
31
+ def delete(key)
32
+ @mutex.synchronize { @store.delete(key) }
25
33
  end
26
34
  end
27
35
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: niftie-cachable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicolas Steenlant