Class: ActionView::LookupContext::DetailsKey

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

Overview

:nodoc:

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeDetailsKey

Returns a new instance of DetailsKey.


79
80
81
# File 'actionview/lib/action_view/lookup_context.rb', line 79

def initialize
  @digest_cache = Concurrent::Map.new
end

Instance Attribute Details

#digest_cacheObject (readonly)

Returns the value of attribute digest_cache


77
78
79
# File 'actionview/lib/action_view/lookup_context.rb', line 77

def digest_cache
  @digest_cache
end

Class Method Details

.clearObject


69
70
71
# File 'actionview/lib/action_view/lookup_context.rb', line 69

def self.clear
  @details_keys.clear
end

.digest_cachesObject


73
74
75
# File 'actionview/lib/action_view/lookup_context.rb', line 73

def self.digest_caches
  @details_keys.values.map(&:digest_cache)
end

.get(details) ⇒ Object


61
62
63
64
65
66
67
# File 'actionview/lib/action_view/lookup_context.rb', line 61

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