module Erubis::Generator

code generator, called by Converter module

Attributes

escapefunc[RW]

Public Instance Methods

add_expr_debug(src, code) click to toggle source

(abstract) add expression code to src for debug. this is called by add_expr().

# File lib/erubis/generator.rb, line 72
def add_expr_debug(src, code)
  not_implemented
end
add_expr_escaped(src, code) click to toggle source

(abstract) add escaped expression code to src. this is called by add_expr().

# File lib/erubis/generator.rb, line 67
def add_expr_escaped(src, code)
  not_implemented
end
add_expr_literal(src, code) click to toggle source

(abstract) add expression literal code to src. this is called by add_expr().

# File lib/erubis/generator.rb, line 62
def add_expr_literal(src, code)
  not_implemented
end
add_postamble(src) click to toggle source

(abstract) add @postamble to src

# File lib/erubis/generator.rb, line 77
def add_postamble(src)
  not_implemented
end
add_preamble(src) click to toggle source

(abstract) add @preamble to src

# File lib/erubis/generator.rb, line 47
def add_preamble(src)
  not_implemented
end
add_stmt(src, code) click to toggle source

(abstract) add statement code to src

# File lib/erubis/generator.rb, line 57
def add_stmt(src, code)
  not_implemented
end
add_text(src, text) click to toggle source

(abstract) add text string to src

# File lib/erubis/generator.rb, line 52
def add_text(src, text)
  not_implemented
end
escape_text(text) click to toggle source

(abstract) escape text string

ex.

def escape_text(text)
  return text.dump
  # or return "'" + text.gsub(/['\\]/, '\\\\\&') + "'"
end
# File lib/erubis/generator.rb, line 36
def escape_text(text)
  not_implemented
end
escaped_expr(code) click to toggle source

return escaped expression code (ex. 'h(…)' or 'htmlspecialchars(…)')

# File lib/erubis/generator.rb, line 41
def escaped_expr(code)
  code.strip!
  return "#{@escapefunc}(#{code})"
end
init_generator(properties={}) click to toggle source
# File lib/erubis/generator.rb, line 24
def init_generator(properties={})
  @escapefunc = properties[:escapefunc]
end