Class: Erubis::Helpers::RailsHelper::PreprocessingEruby

Inherits:
Eruby
  • Object
show all
Defined in:
lib/erubis/helpers/rails_helper.rb

Instance Attribute Summary

Attributes included from Generator

#escapefunc

Attributes included from Evaluator

#filename, #src

Instance Method Summary collapse

Methods included from ErboutEnhancer

#add_postamble, #add_preamble, desc

Methods included from RubyGenerator

#add_expr_debug, #add_expr_literal, #add_stmt, #add_text, #escape_text, #escaped_expr, #init_generator, supported_properties

Methods included from StringBufferEnhancer

#add_postamble, #add_preamble, desc

Methods included from Generator

#add_expr_debug, #add_expr_literal, #add_postamble, #add_preamble, #add_stmt, #add_text, #escape_text, #escaped_expr, #init_generator, supported_properties

Methods included from RubyEvaluator

#def_method, #evaluate, #result, supported_properties

Methods included from Evaluator

#evaluate, #init_evaluator, #result, supported_properties

Constructor Details

#initialize(input, params = {}) ⇒ PreprocessingEruby

Returns a new instance of PreprocessingEruby.



92
93
94
95
96
97
# File 'lib/erubis/helpers/rails_helper.rb', line 92

def initialize(input, params={})
  params = params.dup
  params[:pattern] = '\[% %\]'    # use '[%= %]' instead of '<%= %>'
  params[:escape] = true          # transport '[%= %]' and '[%== %]'
  super
end

Instance Method Details

#add_expr_escaped(src, code) ⇒ Object



98
99
100
# File 'lib/erubis/helpers/rails_helper.rb', line 98

def add_expr_escaped(src, code)
  add_expr_literal(src, "_decode((#{code}))")
end