Class: Plyushkin::Cache::Stub

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

Instance Method Summary collapse

Constructor Details

#initializeStub

Returns a new instance of Stub.



2
3
4
# File 'lib/plyushkin/cache/stub.rb', line 2

def initialize
  @cache = {}
end

Instance Method Details

#clearObject



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