Class: Erubis::PreprocessingEruby

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

Overview

for preprocessing

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.



18
19
20
21
22
23
# File 'lib/erubis/preprocessing.rb', line 18

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



25
26
27
# File 'lib/erubis/preprocessing.rb', line 25

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