Class: Kwartz::ErubyTranslator

Inherits:
BaseTranslator show all
Includes:
RubyExpressionParser
Defined in:
lib/kwartz/binding/eruby.rb

Overview

translator for eRuby

Constant Summary collapse

ERUBY_EMBED_PATTERNS =
[
  '<% ',    ' %>',        # statement
  '<%= ',   ' %>',        # expression
  '<%=h ',  ' %>',        # escaped expression
]

Instance Attribute Summary

Attributes inherited from BaseTranslator

#escape, #footer, #header

Instance Method Summary collapse

Methods included from RubyExpressionParser

#parse_expr_str, #parse_expr_str!

Methods inherited from BaseTranslator

#translate, #translate_native_expr, #translate_native_stmt, #translate_print_stmt, #translate_string

Methods inherited from Translator

get_class, register_class, #translate, #translate_native_expr, #translate_native_stmt, #translate_print_stmt, #translate_string

Constructor Details

#initialize(properties = {}) ⇒ ErubyTranslator

Returns a new instance of ErubyTranslator.



40
41
42
# File 'lib/kwartz/binding/eruby.rb', line 40

def initialize(properties={})
  super(ERUBY_EMBED_PATTERNS, properties)
end