Sha256: f80c9736ce725dbbfaa33cedbc347f3972919f17b3f65c7d806a28aed7854bae

Contents?: true

Size: 418 Bytes

Versions: 107

Compression:

Stored size: 418 Bytes

Contents

module Temple
  module Generators
    # Implements a string buffer.
    #
    #   _buf = ''
    #   _buf << "static"
    #   _buf << dynamic.to_s
    #   _buf
    #
    # @api public
    class StringBuffer < ArrayBuffer
      def create_buffer
        "#{buffer} = ''"
      end

      def return_buffer
        buffer
      end

      def on_dynamic(code)
        concat("(#{code}).to_s")
      end
    end
  end
end

Version data entries

107 entries across 93 versions & 7 rubygems

Version Path
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/temple-0.8.2/lib/temple/generators/string_buffer.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/temple-0.8.2/lib/temple/generators/string_buffer.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/temple-0.8.2/lib/temple/generators/string_buffer.rb
brakeman-6.1.2 bundle/ruby/3.3.0/gems/temple-0.8.2/lib/temple/generators/string_buffer.rb
brakeman-6.1.1 bundle/ruby/3.0.0/gems/temple-0.8.2/lib/temple/generators/string_buffer.rb
brakeman-6.1.0 bundle/ruby/3.1.0/gems/temple-0.8.2/lib/temple/generators/string_buffer.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/temple-0.8.2/lib/temple/generators/string_buffer.rb
brakeman-6.0.1 bundle/ruby/3.1.0/gems/temple-0.8.2/lib/temple/generators/string_buffer.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/temple-0.8.2/lib/temple/generators/string_buffer.rb
brakeman-6.0.0 bundle/ruby/3.0.0/gems/temple-0.8.2/lib/temple/generators/string_buffer.rb
brakeman-5.4.1 bundle/ruby/3.1.0/gems/temple-0.8.2/lib/temple/generators/string_buffer.rb
temple-0.10.0 lib/temple/generators/string_buffer.rb
brakeman-5.4.0 bundle/ruby/2.7.0/gems/temple-0.8.2/lib/temple/generators/string_buffer.rb
temple-0.9.1 lib/temple/generators/string_buffer.rb
temple-0.9.0 lib/temple/generators/string_buffer.rb
brakeman-5.3.1 bundle/ruby/2.7.0/gems/temple-0.8.2/lib/temple/generators/string_buffer.rb
brakeman-5.3.0 bundle/ruby/2.7.0/gems/temple-0.8.2/lib/temple/generators/string_buffer.rb
brakeman-5.2.3 bundle/ruby/2.7.0/gems/temple-0.8.2/lib/temple/generators/string_buffer.rb
brakeman-5.2.2 bundle/ruby/2.7.0/gems/temple-0.8.2/lib/temple/generators/string_buffer.rb
brakeman-5.2.1 bundle/ruby/2.7.0/gems/temple-0.8.2/lib/temple/generators/string_buffer.rb