class Erubi::CaptureEndEngine

An engine class that supports capturing blocks via the <%|= and <%|== tags, explicitly ending the captures using <%| end %> blocks.

Public Class Methods

new(input, properties={}) click to toggle source

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.

# File lib/erubi/capture_end.rb, line 13
def initialize(input, properties={})
  properties = Hash[properties]
  escape = properties.fetch(:escape){properties.fetch(:escape_html, false)}
  @escape_capture = properties.fetch(:escape_capture, escape)
  @bufval = properties[:bufval] ||= 'String.new'
  @bufstack = '__erubi_stack'
  properties[:regexp] ||= /<%(\|?={1,2}|-|\#|%|\|)?(.*?)([-=])?%>([ \t]*\r?\n)?/
  super
end