Class: Padrino::Helpers::OutputHelpers::ErbHandler

Inherits:
AbstractHandler show all
Defined in:
padrino-helpers/lib/padrino-helpers/output_helpers/erb_handler.rb

Overview

Handler for Erb template.

Instance Attribute Summary

Attributes inherited from AbstractHandler

#output_buffer, #template

Instance Method Summary collapse

Methods inherited from AbstractHandler

#capture_from_template, #initialize

Constructor Details

This class inherits a constructor from Padrino::Helpers::OutputHelpers::AbstractHandler

Instance Method Details

#concat_to_template(text = "") ⇒ Object

Outputs the given text to the templates buffer directly.



11
12
13
14
# File 'padrino-helpers/lib/padrino-helpers/output_helpers/erb_handler.rb', line 11

def concat_to_template(text="")
  output_buffer << text
  nil
end

#engine_matches?(block) ⇒ Boolean

Returns true if the block is Erb.

Returns:

  • (Boolean)


19
20
21
# File 'padrino-helpers/lib/padrino-helpers/output_helpers/erb_handler.rb', line 19

def engine_matches?(block)
  block.binding.eval('defined? __in_erb_template')
end