Class: Shhh::App::Cache
- Inherits:
-
Object
- Object
- Shhh::App::Cache
- Includes:
- Singleton
- Defined in:
- lib/shhh/app/cache.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.configure ⇒ Object
14 15 16 |
# File 'lib/shhh/app/cache.rb', line 14 def configure Coin.uri = 'druby://127.0.0.1:24924' end |
Instance Method Details
#[](key) ⇒ Object
25 26 27 |
# File 'lib/shhh/app/cache.rb', line 25 def [] (key) Coin.read(md5(key)) end |
#[]=(key, value) ⇒ Object
29 30 31 |
# File 'lib/shhh/app/cache.rb', line 29 def []=(key, value) Coin.write(md5(key), value) end |
#md5(string) ⇒ Object
21 22 23 |
# File 'lib/shhh/app/cache.rb', line 21 def md5(string) Digest::MD5.base64digest(string) end |