| Module | Erubis::Generator |
| In: |
erubis/generator.rb
|
| escapefunc | [RW] |
(abstract) add expression code to src for debug. this is called by add_expr().
# File erubis/generator.rb, line 70 def add_expr_debug(src, code) not_implemented end
(abstract) add escaped expression code to src. this is called by add_expr().
# File erubis/generator.rb, line 65 def add_expr_escaped(src, code) not_implemented end
(abstract) add expression literal code to src. this is called by add_expr().
# File erubis/generator.rb, line 60 def add_expr_literal(src, code) not_implemented end
(abstract) add @postamble to src
# File erubis/generator.rb, line 75 def add_postamble(src) not_implemented end
(abstract) add @preamble to src
# File erubis/generator.rb, line 45 def add_preamble(src) not_implemented end
(abstract) add statement code to src
# File erubis/generator.rb, line 55 def add_stmt(src, code) not_implemented end
(abstract) add text string to src
# File erubis/generator.rb, line 50 def add_text(src, text) not_implemented end
(abstract) escape text string
ex.
def escape_text(text)
return text.dump
# or return "'" + text.gsub(/['\\]/, '\\\\\&') + "'"
end
# File erubis/generator.rb, line 34 def escape_text(text) not_implemented end
return escaped expression code (ex. ‘h(…)’ or ‘htmlspecialchars(…)’)
# File erubis/generator.rb, line 39 def escaped_expr(code) code.strip! return "#{@escapefunc}(#{code})" end