Class: Keynote::Inline::Template

Inherits:
ActionView::Template
  • Object
show all
Defined in:
lib/keynote/inline.rb

Instance Method Summary collapse

Instance Method Details

#compile!(view) ⇒ Object

The only difference between this #compile! and the normal one is that we call ‘view.class` instead of `view.singleton_class`, so that the template method gets defined as an instance method on the presenter and therefore sticks around between presenter instances.



193
194
195
196
197
198
199
200
201
202
203
204
# File 'lib/keynote/inline.rb', line 193

def compile!(view)
  return if @compiled

  @compile_mutex.synchronize do
    return if @compiled

    compile(view.class)

    @source = nil if defined?(@virtual_path) && @virtual_path
    @compiled = true
  end
end