Class: ActionController::Caching::Fragments::MemoryStore
- Defined in:
- lib/action_controller/caching.rb
Overview
:nodoc:
Direct Known Subclasses
Instance Method Summary collapse
-
#delete(name, options = {}) ⇒ Object
:nodoc:.
-
#initialize ⇒ MemoryStore
constructor
A new instance of MemoryStore.
-
#read(name, options = {}) ⇒ Object
:nodoc:.
-
#write(name, value, options = {}) ⇒ Object
:nodoc:.
Constructor Details
#initialize ⇒ MemoryStore
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, = {}) #: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, = {}) #: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, = {}) #:nodoc: @mutex.synchronize { @data[name] = value } end |