Module: Erubis::PreprocessingHelper

Included in:
ActionView::Base, ActionView::TemplateHandlers::ErubisHandler
Defined in:
lib/erubis/preprocessing.rb

Overview

helper methods for preprocessing

Class Method Summary collapse

Class Method Details

._decode(arg) ⇒ Object



48
49
50
51
52
53
# File 'lib/erubis/preprocessing.rb', line 48

def _decode(arg)
  arg = arg.to_s
  arg.gsub!(/%3C%25(?:=|%3D)(.*?)%25%3E/) { "<%=#{CGI.unescape($1)}%>" }
  arg.gsub!(/&lt;%=(.*?)%&gt;/) { "<%=#{CGI.unescapeHTML($1)}%>" }
  return arg
end

._P(arg) ⇒ Object



42
43
44
# File 'lib/erubis/preprocessing.rb', line 42

def _P(arg)
  return "<%=h(#{arg})%>"
end

._p(arg) ⇒ Object Also known as: _?



38
39
40
# File 'lib/erubis/preprocessing.rb', line 38

def _p(arg)
  return "<%=#{arg}%>"
end