Class: SC::RenderEngine::Haml
- Defined in:
- lib/sproutcore/render_engines/haml.rb
Instance Method Summary collapse
- #capture(*args, &block) ⇒ Object
- #compile(input) ⇒ Object
- #concat(string, binding) ⇒ Object
-
#initialize(html_context) ⇒ Haml
constructor
A new instance of Haml.
Constructor Details
#initialize(html_context) ⇒ Haml
Returns a new instance of Haml.
14 15 16 |
# File 'lib/sproutcore/render_engines/haml.rb', line 14 def initialize(html_context) @html_context = html_context end |
Instance Method Details
#capture(*args, &block) ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/sproutcore/render_engines/haml.rb', line 26 def capture(*args, &block) if @html_context.respond_to?(:is_haml?) && @html_context.is_haml? @html_context.capture_haml(nil, &block) else block.call(*args).to_s end end |
#compile(input) ⇒ Object
18 19 20 |
# File 'lib/sproutcore/render_engines/haml.rb', line 18 def compile(input) ::Haml::Engine.new(input).compiler.send(:precompiled_with_ambles, []) end |
#concat(string, binding) ⇒ Object
22 23 24 |
# File 'lib/sproutcore/render_engines/haml.rb', line 22 def concat(string, binding) eval("_hamlout", binding).push_text string end |