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



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

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



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

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

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



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

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