| Class | Uttk::Dumpers::Dumper |
| In: |
lib/uttk/dumpers/Dumper.rb
|
| Parent: | Logger::Backend |
The dumper is a specific Logger::Backend.
It react to method calls by writting in the output. The output must be acceded like that:
* Using the print method * Using the puts method * Using the << method
If you really need to access to the real outputs use each_output.
You can safely call flush in your methods because this method take care of closed and unflushable outputs.
| options | [RW] |
# File lib/uttk/dumpers/Dumper.rb, line 30 def initialize ( output=STDOUT, *args ) @outputs = [output] while args.first.is_a? IO do @outputs << args.shift end @options = args super() end
# File lib/uttk/dumpers/Dumper.rb, line 40 def flush each_output do |o| o.flush if o.respond_to? :flush and (not o.closed?) end end
# File lib/uttk/dumpers/Dumper.rb, line 59 def print ( *args ) each_output do |o| o.print(*args) end end