Files
metasploit-gs/lib/rex/ui/text/output/buffer.rb
T
Matt Miller 3e69f46a3a added support for manual ranking
git-svn-id: file:///home/svn/framework3/trunk@3866 4d416f70-5f16-0410-b530-b9f4589650da
2006-09-12 05:34:58 +00:00

51 lines
572 B
Ruby

require 'rex/ui'
module Rex
module Ui
module Text
###
#
# This class implements output against a buffer.
#
###
class Output::Buffer < Rex::Ui::Text::Output
#
# Initializes an output buffer.
#
def initialize
self.buf = ''
end
#
# Appends the supplied message to the output buffer.
#
def print(msg = '')
self.buf += msg || ''
if self.on_print_proc
self.on_print_proc.call(msg)
end
msg
end
#
# Reset the buffer to an empty string.
#
def reset
self.buf = ''
end
#
# The underlying buffer state.
#
attr_accessor :buf
end
end
end
end