class method
self.digest
Ruby on Rails 4.1.16
Since v4.0.13Signature
self.digest(options)
Supported options:
-
name- Template name -
finder- An instance of ActionView::LookupContext -
dependencies- An array of dependent views -
partial- Specifies whether the template is a partial
Parameters
-
optionsreq
Source
# File actionview/lib/action_view/digestor.rb, line 18
def digest(options)
options.assert_valid_keys(:name, :finder, :dependencies, :partial)
cache_key = ([ options[:name], options[:finder].details_key.hash ].compact + Array.wrap(options[:dependencies])).join('.')
# this is a correctly done double-checked locking idiom
# (ThreadSafe::Cache's lookups have volatile semantics)
@@cache[cache_key] || @@digest_monitor.synchronize do
@@cache.fetch(cache_key) do # re-check under lock
compute_and_store_digest(cache_key, options)
end
end
end
Defined in actionview/lib/action_view/digestor.rb line 18
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionView::Digestor