Class: CabbageDoc::Cache
- Inherits:
-
Object
- Object
- CabbageDoc::Cache
- Defined in:
- lib/cabbage_doc/cache.rb
Instance Method Summary collapse
- #clear ⇒ Object
- #delete(key) ⇒ Object
-
#initialize ⇒ Cache
constructor
A new instance of Cache.
- #read(key) ⇒ Object
- #write(key, value, options = {}) ⇒ Object
Constructor Details
#initialize ⇒ Cache
Returns a new instance of Cache.
3 4 5 |
# File 'lib/cabbage_doc/cache.rb', line 3 def initialize clear end |
Instance Method Details
#clear ⇒ Object
19 20 21 |
# File 'lib/cabbage_doc/cache.rb', line 19 def clear @_data = {} end |
#delete(key) ⇒ Object
15 16 17 |
# File 'lib/cabbage_doc/cache.rb', line 15 def delete(key) @_data.delete(key) end |
#read(key) ⇒ Object
11 12 13 |
# File 'lib/cabbage_doc/cache.rb', line 11 def read(key) @_data[key] end |
#write(key, value, options = {}) ⇒ Object
7 8 9 |
# File 'lib/cabbage_doc/cache.rb', line 7 def write(key, value, = {}) @_data[key] = value end |