Class: RemoteRuby::TeeWriter
- Inherits:
-
Object
- Object
- RemoteRuby::TeeWriter
- Defined in:
- lib/remote_ruby/tee_writer.rb
Overview
Implements a tee writer that writes to multiple writers
Instance Attribute Summary collapse
-
#writers ⇒ Object
readonly
Returns the value of attribute writers.
Instance Method Summary collapse
-
#initialize(*writers) ⇒ TeeWriter
constructor
A new instance of TeeWriter.
- #write(*args) ⇒ Object
Constructor Details
#initialize(*writers) ⇒ TeeWriter
Returns a new instance of TeeWriter.
8 9 10 |
# File 'lib/remote_ruby/tee_writer.rb', line 8 def initialize(*writers) @writers = writers end |
Instance Attribute Details
#writers ⇒ Object (readonly)
Returns the value of attribute writers.
6 7 8 |
# File 'lib/remote_ruby/tee_writer.rb', line 6 def writers @writers end |
Instance Method Details
#write(*args) ⇒ Object
12 13 14 |
# File 'lib/remote_ruby/tee_writer.rb', line 12 def write(*args) writers.map { |writer| writer.write(*args) }.min end |