Class: Temple::Generators::Array

Inherits:
Temple::Generator show all
Defined in:
lib/temple/generators/array.rb

Overview

Implements an array buffer.

_buf = []
_buf << "static"
_buf << dynamic
_buf

Direct Known Subclasses

ArrayBuffer

Constant Summary

Constants included from Utils

Utils::ESCAPE_HTML, Utils::ESCAPE_HTML_PATTERN

Instance Attribute Summary

Attributes included from Mixins::Options

#options

Instance Method Summary collapse

Methods inherited from Temple::Generator

#call, #on, #on_capture, #on_code, #on_dynamic, #on_multi, #on_newline, #on_static, #postamble, #preamble, #restore_buffer, #save_buffer

Methods included from Mixins::Options

included, #initialize

Methods included from Mixins::CompiledDispatcher

#call, #compile

Methods included from Utils

#empty_exp?, #escape_html, #escape_html_safe, #indent_dynamic, #unique_name

Instance Method Details

#create_bufferObject



13
14
15
# File 'lib/temple/generators/array.rb', line 13

def create_buffer
  "#{buffer} = []"
end

#return_bufferObject



17
18
19
# File 'lib/temple/generators/array.rb', line 17

def return_buffer
  buffer
end