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.
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, = {}) #: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, = {}) #: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, = {}) #:nodoc: @mutex.synchronize { @data[name] = value } end |