Class: Slim::EmbeddedEngine::InterpolateTiltEngine Private

Inherits:
TiltEngine show all
Defined in:
lib/slim/embedded_engine.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Static template with interpolated ruby code

Instance Method Summary collapse

Methods inherited from TiltEngine

#on_slim_embedded

Methods inherited from Slim::EmbeddedEngine

#on_slim_embedded, register

Methods inherited from Filter

#on_slim_attrs, #on_slim_condcomment, #on_slim_control, #on_slim_embedded, #on_slim_output, #on_slim_tag

Constructor Details

#initialize(opts = {}) ⇒ InterpolateTiltEngine

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of InterpolateTiltEngine.



138
139
140
141
# File 'lib/slim/embedded_engine.rb', line 138

def initialize(opts = {})
  super
  @protect = ProtectOutput.new
end

Instance Method Details

#collect_text(body) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



143
144
145
146
# File 'lib/slim/embedded_engine.rb', line 143

def collect_text(body)
  text = Interpolation.new.call(body)
  @protect.call(text)
end

#tilt_render(tilt_engine, tilt_options, text) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



148
149
150
# File 'lib/slim/embedded_engine.rb', line 148

def tilt_render(tilt_engine, tilt_options, text)
  @protect.unprotect(tilt_engine.new(tilt_options) { text }.render)
end