Class: Temple::Generators::Array

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

Overview

Implements an array buffer.

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

Direct Known Subclasses

ArrayBuffer, StringBuffer

Instance Attribute Summary

Attributes included from Mixins::Options

#options

Instance Method Summary collapse

Methods inherited from Temple::Generator

#call, #compile, #on_capture, #on_code, #on_dynamic, #on_multi, #on_newline, #on_static

Methods included from Mixins::Options

included, #initialize

Instance Method Details

#postambleObject



81
82
83
# File 'lib/temple/generators.rb', line 81

def postamble
  buffer
end

#preambleObject



77
78
79
# File 'lib/temple/generators.rb', line 77

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