Module: ViewComponent::CompileCache

Defined in:
lib/view_component/compile_cache.rb

Overview

Keeps track of which templates have already been compiled This isn’t part of the public API

Class Method Summary collapse

Class Method Details

.compiled?(klass) ⇒ Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/view_component/compile_cache.rb', line 17

def compiled?(klass)
  cache.include? klass
end

.invalidate!Object



25
26
27
# File 'lib/view_component/compile_cache.rb', line 25

def invalidate!
  cache.clear
end

.invalidate_class!(klass) ⇒ Object



21
22
23
# File 'lib/view_component/compile_cache.rb', line 21

def invalidate_class!(klass)
  cache.delete(klass)
end

.register(klass) ⇒ Object



13
14
15
# File 'lib/view_component/compile_cache.rb', line 13

def register(klass)
  cache << klass
end