Class: Temple::Templates::Rails

Inherits:
ActionView::TemplateHandler
  • Object
show all
Extended by:
Mixins::Template
Includes:
ActionView::TemplateHandlers::Compilable
Defined in:
lib/temple/templates/rails.rb,
lib/temple/templates/rails.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Mixins::Template

build_engine, chain, engine

Methods included from Mixins::DefaultOptions

#default_options, #set_default_options

Class Method Details

.call(template) ⇒ Object



24
25
26
# File 'lib/temple/templates/rails.rb', line 24

def self.call(template)
  build_engine.call(template.source)
end

.register_as(name) ⇒ Object



16
17
18
# File 'lib/temple/templates/rails.rb', line 16

def self.register_as(name)
  ActionView::Template.register_template_handler name.to_sym, self
end

Instance Method Details

#compile(template) ⇒ Object



12
13
14
# File 'lib/temple/templates/rails.rb', line 12

def compile(template)
  self.class.build_engine.call(template.source)
end