Sha256: 0cb7e3f896cd4916ca1f1973f6b5894dbfb5706872eb6ad5cdf5fa6246f4a9a3
Contents?: true
Size: 778 Bytes
Versions: 1
Compression:
Stored size: 778 Bytes
Contents
# * George Moschovitis <gm@navel.gr> # (c) 2004-2005 Navel, all rights reserved. # $Id: buffering.rb 1 2005-04-11 11:04:30Z gmosx $ require 'glue/attribute' require 'nitro/shaders' module Nitro # The output buffering mixin. Provides php-style output # buffering functionality. module OutputBuffering # Output buffers stack, used for php-style nested output # buffering. attr :out_buffers # Start (push) a new output buffer. def ob_start @out_buffers ||= [] @out_buffers.push(@out) @out = '' end # End (pop) the current output buffer. def ob_end @out = @out_buffers.pop end # End (pop) the current output buffer and write to the parent. def ob_write_end nested_buffer = @out @out = @out_buffers.pop @out << nested_buffer end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
nitro-0.16.0 | lib/nitro/buffering.rb |