Class: DVLA::Herodotus::MultiWriter
- Inherits:
-
Object
- Object
- DVLA::Herodotus::MultiWriter
- Defined in:
- lib/dvla/herodotus/multi_writer.rb
Instance Attribute Summary collapse
-
#targets ⇒ Object
readonly
Returns the value of attribute targets.
Instance Method Summary collapse
- #close ⇒ Object
-
#initialize(*targets) ⇒ MultiWriter
constructor
A new instance of MultiWriter.
- #write(*args) ⇒ Object
Constructor Details
#initialize(*targets) ⇒ MultiWriter
Returns a new instance of MultiWriter.
6 7 8 |
# File 'lib/dvla/herodotus/multi_writer.rb', line 6 def initialize(*targets) @targets = *targets end |
Instance Attribute Details
#targets ⇒ Object (readonly)
Returns the value of attribute targets.
4 5 6 |
# File 'lib/dvla/herodotus/multi_writer.rb', line 4 def targets @targets end |
Instance Method Details
#close ⇒ Object
14 15 16 17 18 |
# File 'lib/dvla/herodotus/multi_writer.rb', line 14 def close @targets.each do |t| t.close unless t.eql? $stdout end end |
#write(*args) ⇒ Object
10 11 12 |
# File 'lib/dvla/herodotus/multi_writer.rb', line 10 def write(*args) @targets.each { |t| t.write(*args) } end |