instance method read

Ruby on Rails 2.3.18

Since v2.3.18 Last seen in v2.3.18

Signature

read(key, options = nil)

No documentation comment.

Parameters

key req
options opt = 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

Type at least 2 characters to search.

Use the arrow keys to navigate results, Enter to open one, Escape to close.

Keyboard shortcuts

/
Focus search
⌘K / Ctrl-K
Command palette
?
This help
Esc
Close