Class: Kwartz::RailsTranslator

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

Overview

translator for rails

Constant Summary collapse

RAILS_EMBED_PATTERNS =
[
  '<% ',    ' -%>',       # statement (chop newline)
  '<%= ',   ' %>',        # 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 = {}) ⇒ RailsTranslator

Returns a new instance of RailsTranslator.



288
289
290
# File 'lib/kwartz/binding/rails.rb', line 288

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