Class: Temple::Generators::StringBuffer
- Inherits:
-
ArrayBuffer
- Object
- Temple::Generator
- Array
- ArrayBuffer
- Temple::Generators::StringBuffer
- Defined in:
- lib/temple/generators/string_buffer.rb
Overview
Implements a string buffer.
_buf = ''
_buf << "static"
_buf << dynamic.to_s
_buf
Direct Known Subclasses
Constant Summary
Constants included from Utils
Utils::ESCAPE_HTML, Utils::ESCAPE_HTML_PATTERN
Instance Attribute Summary
Attributes included from Mixins::Options
Instance Method Summary collapse
Methods inherited from ArrayBuffer
Methods inherited from Temple::Generator
#call, #on, #on_capture, #on_code, #on_multi, #on_newline, #on_static, #postamble, #preamble, #restore_buffer, #save_buffer
Methods included from Mixins::Options
Methods included from Mixins::CompiledDispatcher
Methods included from Utils
#empty_exp?, #escape_html, #escape_html_safe, #indent_dynamic, #unique_name
Instance Method Details
#create_buffer ⇒ Object
13 14 15 |
# File 'lib/temple/generators/string_buffer.rb', line 13 def create_buffer "#{buffer} = ''.dup" end |
#on_dynamic(code) ⇒ Object
21 22 23 |
# File 'lib/temple/generators/string_buffer.rb', line 21 def on_dynamic(code) concat("(#{code}).to_s") end |
#return_buffer ⇒ Object
17 18 19 |
# File 'lib/temple/generators/string_buffer.rb', line 17 def return_buffer buffer end |