Class: ActionView::LookupContext::DetailsKey

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

Overview

:nodoc:

Class Method Summary collapse

Class Method Details

.clearObject



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

def self.clear
  ActionView::ViewPaths.all_view_paths.each do |path_set|
    path_set.each(&:clear_cache)
  end
  ActionView::LookupContext.fallbacks.each(&:clear_cache)
  @view_context_class = nil
  @details_keys.clear
  @digest_cache.clear
end

.details_cache_key(details) ⇒ Object



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

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

.digest_cache(details) ⇒ Object



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

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

.digest_cachesObject



84
85
86
# File 'lib/action_view/lookup_context.rb', line 84

def self.digest_caches
  @digest_cache.values
end

.view_context_class(klass) ⇒ Object



88
89
90
91
92
# File 'lib/action_view/lookup_context.rb', line 88

def self.view_context_class(klass)
  @view_context_mutex.synchronize do
    @view_context_class ||= klass.with_empty_template_cache
  end
end