Class: Erubis::Helpers::RailsHelper::PreprocessingEruby
- Inherits:
-
Eruby
- Object
- Basic::Engine
- Eruby
- Erubis::Helpers::RailsHelper::PreprocessingEruby
- Defined in:
- lib/erubis/helpers/rails_helper.rb
Instance Attribute Summary
Attributes included from Generator
Attributes included from Evaluator
Instance Method Summary collapse
- #add_expr_escaped(src, code) ⇒ Object
-
#initialize(input, params = {}) ⇒ PreprocessingEruby
constructor
A new instance of PreprocessingEruby.
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 |