Class: Minimal::Template::Handler

Inherits:
ActionView::Template::Handler
  • Object
show all
Includes:
ActionView::Template::Handlers::Compilable
Defined in:
lib/minimal/template/handler.rb

Instance Method Summary collapse

Instance Method Details

#compile(template) ⇒ Object



5
6
7
8
9
10
11
12
13
# File 'lib/minimal/template/handler.rb', line 5

def compile(template)
  require_dependency template.identifier
  class_name, format = template_class_name_and_format(template.identifier)
  <<-code
    @output_buffer = ActiveSupport::SafeBuffer.new
    template, format = ::#{class_name}, #{format.inspect}
    template.new(self)._render(local_assigns, format) { |*args| yield(*args) }
  code
end