Class: Erubis::ContextualEruby

Inherits:
Eruby
  • Object
show all
Includes:
ContextualEscapeEnhancer
Defined in:
lib/contextual/contextual.rb

Instance Method Summary collapse

Methods included from ContextualEscapeEnhancer

#add_expr, #add_expr_escaped, #add_expr_literal, #add_stmt, #add_text, desc

Instance Method Details

#add_postamble(src) ⇒ Object



89
90
91
92
93
# File 'lib/contextual/contextual.rb', line 89

def add_postamble(src)
  src << "\n" unless src[-1] == ?\n
  src << "#{@bufvar}.close\n"
  src << "#{@bufvar}.to_s\n"
end

#add_preamble(src) ⇒ Object



85
86
87
# File 'lib/contextual/contextual.rb', line 85

def add_preamble(src)
  src << "#{@bufvar} = Erubis::ContextualBuffer.new; "
end