Class: ActionView::LookupContext::DetailsKey

Inherits:
Object
  • Object
show all
Defined in:
actionview/lib/action_view/lookup_context.rb

Overview

:nodoc:

Class Method Summary collapse

Class Method Details

.clearObject



73
74
75
76
77
78
79
80
# File 'actionview/lib/action_view/lookup_context.rb', line 73

def self.clear
  ActionView::PathRegistry.all_resolvers.each do |resolver|
    resolver.clear_cache
  end
  @view_context_class = nil
  @details_keys.clear
  @digest_cache.clear
end

.details_cache_key(details) ⇒ Object



65
66
67
68
69
70
71
# File 'actionview/lib/action_view/lookup_context.rb', line 65

def self.details_cache_key(details)
  if details[:formats]
    details = details.dup
    details[:formats] &= Template::Types.symbols
  end
  @details_keys[details] ||= TemplateDetails::Requested.new(**details)
end

.digest_cache(details) ⇒ Object



61
62
63
# File 'actionview/lib/action_view/lookup_context.rb', line 61

def self.digest_cache(details)
  @digest_cache[details_cache_key(details)] ||= Concurrent::Map.new
end

.digest_cachesObject



82
83
84
# File 'actionview/lib/action_view/lookup_context.rb', line 82

def self.digest_caches
  @digest_cache.values
end

.view_context_classObject



86
87
88
89
90
# File 'actionview/lib/action_view/lookup_context.rb', line 86

def self.view_context_class
  @view_context_mutex.synchronize do
    @view_context_class ||= ActionView::Base.with_empty_template_cache
  end
end