Module: ViewComponent::CompileCache

Defined in:
lib/view_component/compile_cache.rb

Overview

Keeps track of which templates have already been compiled This is not part of the public API

Class Method Summary collapse

Class Method Details

.compiled?(klass) ⇒ Boolean

Returns:

  • (Boolean)


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

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

.invalidate!Object



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

def invalidate!
  cache.clear
end

.register(klass) ⇒ Object



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

def register(klass)
  cache << klass
end