Class: CabbageDoc::Cache

Inherits:
Object
  • Object
show all
Defined in:
lib/cabbage_doc/cache.rb

Instance Method Summary collapse

Constructor Details

#initializeCache

Returns a new instance of Cache.



3
4
5
# File 'lib/cabbage_doc/cache.rb', line 3

def initialize
  clear
end

Instance Method Details

#clearObject



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, options = {})
  @_data[key] = value
end