Class: Padrino::Helpers::OutputHelpers::AbstractHandler
Direct Known Subclasses
Instance Attribute Summary
-
#output_buffer ⇒ Object
readonly Returns the value of attribute output_buffer. -
#template ⇒ Object
readonly Returns the value of attribute template.
Instance Method Summary
-
#capture_from_template(*args, &block) ⇒ Object
Captures the html from a block of template code for this handler. -
#concat_to_template(text = "", context = nil) ⇒ Object
Outputs the given text to the template. -
#engine_matches?(block) ⇒ Boolean
Returns true if the block given is of the handler's template type; false otherwise. -
#initialize(template) ⇒ AbstractHandler
constructor A new instance of AbstractHandler.
Constructor Details
#initialize(template) ⇒ AbstractHandler
Returns a new instance of AbstractHandler.
Instance Attribute Details
#output_buffer ⇒ Object
Returns the value of attribute output_buffer
#template ⇒ Object (readonly)
Returns the value of attribute template
Instance Method Details
#capture_from_template(*args, &block) ⇒ Object
Captures the html from a block of template code for this handler.
This method is called to capture content of a block-loving helpers in templates. Haml has a special method to do this, for Erb and Slim we save original buffer, call the block and then restore the buffer.
#concat_to_template(text = "", context = nil) ⇒ Object
Outputs the given text to the template.
This method is called when template uses block-aware helpers. For Slim and Haml such helpers just return output to use with `=`. For Erb this method is implemented in ErbHandler by concatenating given text to output buffer.
#engine_matches?(block) ⇒ Boolean
Returns true if the block given is of the handler's template type; false otherwise.
© 2010–2020 Padrino
Licensed under the MIT License.
https://www.rubydoc.info/github/padrino/padrino-framework/Padrino/Helpers/OutputHelpers/AbstractHandler