module Temple::Mixins::Template
@api private
Public Instance Methods
compile(code, options)
click to toggle source
# File lib/temple/mixins/template.rb, line 7 def compile(code, options) engine = options.delete(:engine) raise 'No engine configured' unless engine engine.new(options).call(code) end
create(engine, options)
click to toggle source
# File lib/temple/mixins/template.rb, line 17 def create(engine, options) register_as = options.delete(:register_as) template = Class.new(self) template.disable_option_validator! template.options[:engine] = engine template.options.update(options) template.register_as(*register_as) if register_as template end
register_as(*names)
click to toggle source
# File lib/temple/mixins/template.rb, line 13 def register_as(*names) raise NotImplementedError end