instance method
read
Ruby on Rails 2.3.18
Since v2.3.18 Last seen in v2.3.18Signature
read(key, options = nil)
No documentation comment.
Parameters
-
keyreq -
optionsopt = nil
Source
# File activesupport/lib/active_support/cache/strategy/local_cache.rb, line 34
def read(key, options = nil)
value = local_cache && local_cache.read(key)
if value == NULL
nil
elsif value.nil?
value = super
local_cache.mute { local_cache.write(key, value || NULL) } if local_cache
value.duplicable? ? value.dup : value
else
# forcing the value to be immutable
value.duplicable? ? value.dup : value
end
end
Defined in activesupport/lib/active_support/cache/strategy/local_cache.rb line 34
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::Cache::Strategy::LocalCache