method
new
new(src, trim_mode, percent)
public
Hide source
# File lib/erb.rb, line 384 def initialize(src, trim_mode, percent) super @trim_mode = trim_mode @percent = percent if @trim_mode == '>' @scan_reg = /(.*?)(%>\r?\n|#{(stags + etags).join('|')}|\n|\z)/ @scan_line = self.method(:trim_line1) elsif @trim_mode == '<>' @scan_reg = /(.*?)(%>\r?\n|#{(stags + etags).join('|')}|\n|\z)/ @scan_line = self.method(:trim_line2) elsif @trim_mode == '-' @scan_reg = /(.*?)(^[ \t]*<%\-|<%\-|-%>\r?\n|-%>|#{(stags + etags).join('|')}|\z)/ @scan_line = self.method(:explicit_trim_line) else @scan_reg = /(.*?)(#{(stags + etags).join('|')}|\n|\z)/ @scan_line = self.method(:scan_line) end end