Class: Slim::Embedded::TiltEngine Private

Inherits:
Engine
  • Object
show all
Defined in:
lib/slim/embedded.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.

Basic tilt engine

Direct Known Subclasses

InterpolateTiltEngine, SassEngine

Instance Method Summary collapse

Methods inherited from Filter

#on_slim_control, #on_slim_output, #on_slim_text

Instance Method Details

#on_slim_embedded(engine, body, attrs) ⇒ 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.



135
136
137
138
139
140
# File 'lib/slim/embedded.rb', line 135

def on_slim_embedded(engine, body, attrs)
  tilt_engine = Tilt[engine] || raise(Temple::FilterError, "Tilt engine #{engine} is not available.")
  tilt_options = options[engine.to_sym] || {}
  tilt_options[:default_encoding] ||= 'utf-8'
  [:multi, tilt_render(tilt_engine, tilt_options, collect_text(body)), collect_newlines(body)]
end