Class: Faml::FilterCompilers::TiltBase
- Inherits:
-
Base
- Object
- Base
- Faml::FilterCompilers::TiltBase
show all
- Includes:
- Temple::Utils
- Defined in:
- lib/faml/filter_compilers/tilt_base.rb
Class Method Summary
collapse
Methods inherited from Base
#need_newline?
Class Method Details
.render_with_tilt(name, source, indent_width: 0) ⇒ Object
11
12
13
14
15
|
# File 'lib/faml/filter_compilers/tilt_base.rb', line 11
def self.render_with_tilt(name, source, indent_width: 0)
text = ::Tilt["t.#{name}"].new { source }.render
indent = ' ' * indent_width
"#{indent}#{text.rstrip.gsub("\n", "\n#{indent}")}"
end
|