Class: Temple::Generators::StringBuffer
- Inherits:
-
Array
- Object
- Temple::Generator
- Array
- Temple::Generators::StringBuffer
- Defined in:
- lib/temple/generators.rb
Overview
Implements a string buffer.
_buf = ''
_buf << "static"
_buf << dynamic.to_s
_buf
Direct Known Subclasses
Instance Attribute Summary
Attributes included from Mixins::Options
Instance Method Summary (collapse)
Methods inherited from Array
Methods inherited from Temple::Generator
#call, #compile, #on_capture, #on_code, #on_multi, #on_newline, #on_static
Methods included from Mixins::Options
Instance Method Details
- (Object) on_dynamic(code)
107 108 109 |
# File 'lib/temple/generators.rb', line 107 def on_dynamic(code) concat("(#{code}).to_s") end |
- (Object) preamble
103 104 105 |
# File 'lib/temple/generators.rb', line 103 def preamble "#{buffer} = ''" end |