Class: Kovid::Cache
- Inherits:
-
Object
- Object
- Kovid::Cache
- Defined in:
- lib/kovid/cache.rb
Instance Method Summary collapse
- #get(request) ⇒ Object
-
#initialize ⇒ Cache
constructor
A new instance of Cache.
- #set(request, response) ⇒ Object
Constructor Details
#initialize ⇒ Cache
Returns a new instance of Cache.
6 7 8 |
# File 'lib/kovid/cache.rb', line 6 def initialize @memory = {} end |
Instance Method Details
#get(request) ⇒ Object
10 11 12 |
# File 'lib/kovid/cache.rb', line 10 def get(request) @memory[request] end |
#set(request, response) ⇒ Object
14 15 16 |
# File 'lib/kovid/cache.rb', line 14 def set(request, response) @memory[request] = response end |