Class: Plyushkin::Cache::Stub
- Inherits:
-
Object
- Object
- Plyushkin::Cache::Stub
- Defined in:
- lib/plyushkin/cache/stub.rb
Instance Method Summary collapse
- #clear ⇒ Object
-
#initialize ⇒ Stub
constructor
A new instance of Stub.
- #read(key) ⇒ Object
- #write(key, value) ⇒ Object
Constructor Details
#initialize ⇒ Stub
Returns a new instance of Stub.
2 3 4 |
# File 'lib/plyushkin/cache/stub.rb', line 2 def initialize @cache = {} end |
Instance Method Details
#clear ⇒ Object
14 15 16 |
# File 'lib/plyushkin/cache/stub.rb', line 14 def clear @cache = {} end |
#read(key) ⇒ Object
10 11 12 |
# File 'lib/plyushkin/cache/stub.rb', line 10 def read(key) @cache[key] end |
#write(key, value) ⇒ Object
6 7 8 |
# File 'lib/plyushkin/cache/stub.rb', line 6 def write(key, value) @cache[key] = value end |