class Sus::Output::Buffered

def append(buffer)

def append(buffer)
	@chunks.concat(buffer.chunks)
	@tee&.append(buffer)
end

def assert(*arguments)

def assert(*arguments)
	@chunks << [:assert, *arguments]
	@tee&.assert(*arguments)
end

def buffered

def buffered
	self.class.new(self)
end

def each(&block)

def each(&block)
	@chunks.each(&block)
end

def error(*arguments)

def error(*arguments)
	@chunks << [:error, *arguments]
	@tee&.error(*arguments)
end

def indent

def indent
	@chunks << INDENT
	@tee&.indent
end

def indented

def indented
	self.indent
	yield
ensure
	self.outdent
end

def inform(*arguments)

def inform(*arguments)
	@chunks << [:inform, *arguments]
	@tee&.inform(*arguments)
end

def initialize(tee = nil)

def initialize(tee = nil)
	@chunks = Array.new
	@tee = tee
end

def inspect

def inspect
	if @tee
		"\#<#{self.class.name} #{@chunks.size} chunks -> #{@tee.class}>"
	else
		"\#<#{self.class.name} #{@chunks.size} chunks>"
	end
end

def outdent

def outdent
	@chunks << OUTDENT
	@tee&.outdent
end

def puts(*arguments)

def puts(*arguments)
	@chunks << [:puts, *arguments]
	@tee&.puts(*arguments)
end

def skip(*arguments)

def skip(*arguments)
	@chunks << [:skip, *arguments]
	@tee&.skip(*arguments)
end

def string

def string
	io = StringIO.new
	Text.new(io).append(@chunks)
	return io.string
end

def write(*arguments)

def write(*arguments)
	@chunks << [:write, *arguments]
	@tee&.write(*arguments)
end