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.



288
289
290
# File 'lib/action_controller/caching.rb', line 288

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

Instance Method Details

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

:nodoc:



304
305
306
# File 'lib/action_controller/caching.rb', line 304

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

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

:nodoc:



292
293
294
295
296
297
298
# File 'lib/action_controller/caching.rb', line 292

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

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

:nodoc:



300
301
302
# File 'lib/action_controller/caching.rb', line 300

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