Object
@abstract Extend this to create a template handler
Returns true if the block given is of the handler’s template type; false otherwise.
@example
@handler.block_is_type?(block) => true
# File lib/padrino-helpers/output_helpers/abstract_handler.rb, line 72 def block_is_type?(block) # Implemented in subclass end
Captures the html from a block of template code for this handler
@example
@handler.capture_from_template(&block) => "...html..."
# File lib/padrino-helpers/output_helpers/abstract_handler.rb, line 82 def capture_from_template(*args, &block) # Implemented in subclass end
Outputs the given text to the templates buffer directly
@example
@handler.concat_to_template("This will be output to the template buffer")
# File lib/padrino-helpers/output_helpers/abstract_handler.rb, line 92 def concat_to_template(text="") # Implemented in subclass end
Returns an array of engines used for the template
@example
@handler.engines => [:erb, :erubis]
# File lib/padrino-helpers/output_helpers/abstract_handler.rb, line 52 def engines # Implemented in subclass end
Returns true if the current template type is same as this handlers; false otherwise.
@example
@handler.is_type? => true
# File lib/padrino-helpers/output_helpers/abstract_handler.rb, line 62 def is_type? # Implemented in subclass end
Returns extension of the template
@example
@handler.template_extension => "erb"
# File lib/padrino-helpers/output_helpers/abstract_handler.rb, line 40 def template_extension caller.find { |c| c =~ /\/views\// }[/\.([\w]*?)\:/, 1] rescue nil # "/some/path/app/views/posts/foo.html.erb:3:in `evaluate_source'" # => "erb" end
Generated with the Darkfish Rdoc Generator 2.