Class: Bridgetown::Container::Interceptor

Inherits:
Object
  • Object
show all
Defined in:
bridgetown-core/lib/bridgetown-core/container/interceptor.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#readerObject (readonly)

Returns the value of attribute reader.



5
6
7
# File 'bridgetown-core/lib/bridgetown-core/container/interceptor.rb', line 5

def reader
  @reader
end

#writerObject (readonly)

Returns the value of attribute writer.



5
6
7
# File 'bridgetown-core/lib/bridgetown-core/container/interceptor.rb', line 5

def writer
  @writer
end

Class Method Details

.with_tag(tag, color:) ⇒ Object



7
8
9
# File 'bridgetown-core/lib/bridgetown-core/container/interceptor.rb', line 7

def self.with_tag(tag, color:)
  new(tag, color: color)
end

Instance Method Details

#hookObject



11
12
13
14
15
# File 'bridgetown-core/lib/bridgetown-core/container/interceptor.rb', line 11

def hook
  $stdin.reopen(@reader)
  $stdout.reopen(@writer)
  $stderr.reopen(@writer)
end