Class: Erubi::CaptureEngine
Overview
An engine class that supports capturing blocks via the <%|= and <%|== tags.
Instance Attribute Summary
Attributes inherited from Engine
Instance Method Summary collapse
-
#initialize(input, properties = {}) ⇒ CaptureEngine
constructor
Initializes the engine.
Constructor Details
#initialize(input, properties = {}) ⇒ CaptureEngine
Initializes the engine. Accepts the same arguments as ::Erubi::Engine, and these additional options:
- :escape_capture
-
Whether to make <%|= escape by default, and <%|== not escape by default, defaults to the same value as :escape.
63 64 65 66 67 68 69 70 |
# File 'lib/erubi/capture.rb', line 63 def initialize(input, properties={}) properties = Hash[properties] escape = properties.fetch(:escape){properties.fetch(:escape_html, false)} @escape_capture = properties.fetch(:escape_capture, escape) properties[:regexp] ||= /<%(\|?={1,2}|-|\#|%)?(.*?)([-=])?%>([ \t]*\r?\n)?/m properties[:bufval] ||= "::Erubi::Buffer.new" super end |