Class: Cosmos::Stdout
- Inherits:
-
IoMultiplexer
- Object
- IoMultiplexer
- Cosmos::Stdout
- Defined in:
- lib/cosmos/io/stdout.rb
Overview
Adds STDOUT to the multiplexed streams
Constant Summary collapse
- @@instance =
nil
Class Method Summary collapse
-
.instance ⇒ Stdout
Returns a single instance of Stdout.
Instance Method Summary collapse
-
#initialize ⇒ Stdout
constructor
A new instance of Stdout.
- #tty? ⇒ Boolean
Methods inherited from IoMultiplexer
#add_stream, #flush, #print, #printf, #putc, #puts, #remove_default_io, #remove_stream, #write, #write_nonblock
Constructor Details
#initialize ⇒ Stdout
Returns a new instance of Stdout.
19 20 21 22 23 |
# File 'lib/cosmos/io/stdout.rb', line 19 def initialize super() @streams << STDOUT @@instance = self end |
Class Method Details
.instance ⇒ Stdout
Returns a single instance of Stdout
26 27 28 29 |
# File 'lib/cosmos/io/stdout.rb', line 26 def self.instance self.new unless @@instance @@instance end |
Instance Method Details
#tty? ⇒ Boolean
31 32 33 |
# File 'lib/cosmos/io/stdout.rb', line 31 def tty? false end |