Class: ActionController::Caching::Fragments::MemoryStore

Inherits:
Object
  • Object
show all
Defined in:
lib/action_controller/caching.rb

Overview

:nodoc:

Direct Known Subclasses

DRbStore, MemCacheStore

Instance Method Summary collapse

Constructor Details

#initializeMemoryStore

Returns a new instance of MemoryStore.



290
291
292
# File 'lib/action_controller/caching.rb', line 290

def initialize
  @data, @mutex = { }, Mutex.new
end

Instance Method Details

#delete(name, options = {}) ⇒ Object

:nodoc:



302
303
304
# File 'lib/action_controller/caching.rb', line 302

def delete(name, options = {}) #:nodoc:
  @mutex.synchronize { @data.delete(name) }
end

#read(name, options = {}) ⇒ Object

:nodoc:



294
295
296
# File 'lib/action_controller/caching.rb', line 294

def read(name, options = {}) #:nodoc:
  @mutex.synchronize { @data[name] } rescue nil
end

#write(name, value, options = {}) ⇒ Object

:nodoc:



298
299
300
# File 'lib/action_controller/caching.rb', line 298

def write(name, value, options = {}) #:nodoc:
  @mutex.synchronize { @data[name] = value }
end