Class: Rhinestone::InMemoryCacheBackend

Inherits:
Object
  • Object
show all
Defined in:
lib/rhinestone/in_memory_cache_backend.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeInMemoryCacheBackend

Returns a new instance of InMemoryCacheBackend.



5
6
7
# File 'lib/rhinestone/in_memory_cache_backend.rb', line 5

def initialize
  @data = {}
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



3
4
5
# File 'lib/rhinestone/in_memory_cache_backend.rb', line 3

def data
  @data
end

Instance Method Details

#get(key) ⇒ Object



13
14
15
# File 'lib/rhinestone/in_memory_cache_backend.rb', line 13

def get(key)
  data[key]
end

#set(key, value) ⇒ Object



9
10
11
# File 'lib/rhinestone/in_memory_cache_backend.rb', line 9

def set(key, value)
  data[key] = value
end