Module: Haml::Filters::ERB
- Includes:
- Base
- Defined in:
- /var/build/temp/tmp.g5C1f6zb2g/4.0-0-0/ruby-haml/ruby-haml-3.1.6/lib/haml/filters.rb
Overview
Parses the filtered text with ERB. Not available if the :suppress_eval
option is set to true. Embedded Ruby code is evaluated in the same context as the Haml template.
Instance Method Summary (collapse)
Methods included from Base
included, #internal_compile, #lazy_require, #render, #render_with_options
Instance Method Details
- compile(compiler, text)
319 320 321 322 323 324 |
# File '/var/build/temp/tmp.g5C1f6zb2g/4.0-0-0/ruby-haml/ruby-haml-3.1.6/lib/haml/filters.rb', line 319
def compile(compiler, text)
return if compiler.options[:suppress_eval]
src = ::ERB.new(text).src.sub(/^#coding:.*?\n/, '').
sub(/^_erbout = '';/, "")
compiler.send(:push_silent, src)
end
|