Sha256: b637808435623b74fb9489d7cf5367c6f86392ad6669f75c57928f6a6927f969

Contents?: true

Size: 529 Bytes

Versions: 1

Compression:

Stored size: 529 Bytes

Contents

# Renderers for Box
#
module Rockit
  module PrettyPrint
    module Box
      class Renderer
	def reset_buffer
	  @buffer = ""
	end

	def string_buffer
	  @buffer
	end

	def render(boxTree)
	  reset_buffer
	  render_term(boxTree)
	  string_buffer
	end

	def <<(string)
	  @buffer << string
	end

	def render_term(boxTree)
	  raise NotImplementedError
	end

	def render_hdelim(num)
	  render_term(horizontal_delim * num)
	end
      end
    end
  end
end

class String
  def render_as_text(renderer)
    renderer << self
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rockit-0.7.1 lib/rockit/prettyprint/renderer.rb