Module: Console::Output::Default

Defined in:
lib/console/output/default.rb

Overview

Default output format selection.

Class Method Summary collapse

Class Method Details

.new(stream, **options) ⇒ Object

Create a new output format based on the given stream.



19
20
21
22
23
24
25
26
27
28
29
# File 'lib/console/output/default.rb', line 19

def self.new(stream, **options)
	stream ||= $stderr
	
	if stream.tty?
		output = Terminal.new(stream, **options)
	else
		output = Serialized.new(stream, **options)
	end
	
	return output
end