Class: Padrino::Helpers::OutputHelpers::HamlHandler
- Inherits:
-
AbstractHandler
- Object
- AbstractHandler
- Padrino::Helpers::OutputHelpers::HamlHandler
- Defined in:
- padrino-helpers/lib/padrino-helpers/output_helpers/haml_handler.rb
Overview
Handler for Haml templates.
Instance Attribute Summary
Attributes inherited from AbstractHandler
Instance Method Summary collapse
-
#capture_from_template(*args, &block) ⇒ Object
Captures the html from a block of template code for this handler.
-
#engine_matches?(block) ⇒ Boolean
Returns true if the block is for Haml.
Methods inherited from AbstractHandler
#concat_to_template, #initialize
Constructor Details
This class inherits a constructor from Padrino::Helpers::OutputHelpers::AbstractHandler
Instance Method Details
#capture_from_template(*args, &block) ⇒ Object
Captures the html from a block of template code for this handler.
20 21 22 |
# File 'padrino-helpers/lib/padrino-helpers/output_helpers/haml_handler.rb', line 20 def capture_from_template(*args, &block) engine_matches?(block) ? template.capture_haml(*args, &block) : yield(*args) end |
#engine_matches?(block) ⇒ Boolean
Returns true if the block is for Haml
13 14 15 |
# File 'padrino-helpers/lib/padrino-helpers/output_helpers/haml_handler.rb', line 13 def engine_matches?(block) template.block_is_haml?(block) end |