Class: CableReady::Updatable::MemoryCacheDebounceAdapter

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
app/models/concerns/cable_ready/updatable/memory_cache_debounce_adapter.rb

Instance Method Summary collapse

Constructor Details

#initializeMemoryCacheDebounceAdapter

Returns a new instance of MemoryCacheDebounceAdapter.



10
11
12
13
# File 'app/models/concerns/cable_ready/updatable/memory_cache_debounce_adapter.rb', line 10

def initialize
  super
  @store = ActiveSupport::Cache::MemoryStore.new(expires_in: 5.minutes, size: 8.megabytes)
end

Instance Method Details

#[](key) ⇒ Object



19
20
21
# File 'app/models/concerns/cable_ready/updatable/memory_cache_debounce_adapter.rb', line 19

def [](key)
  @store.read(key)
end

#[]=(key, value) ⇒ Object



15
16
17
# File 'app/models/concerns/cable_ready/updatable/memory_cache_debounce_adapter.rb', line 15

def []=(key, value)
  @store.write(key, value)
end