Class: Logz::MultiIO
- Inherits:
-
Object
- Object
- Logz::MultiIO
- Defined in:
- lib/logz/multi_io.rb
Instance Attribute Summary collapse
-
#targets ⇒ Object
readonly
Returns the value of attribute targets.
Instance Method Summary collapse
- #close ⇒ Object
- #flush ⇒ Object
-
#initialize(*targets) ⇒ MultiIO
constructor
A new instance of MultiIO.
- #write(*args) ⇒ Object
Constructor Details
#initialize(*targets) ⇒ MultiIO
Returns a new instance of MultiIO.
5 6 7 |
# File 'lib/logz/multi_io.rb', line 5 def initialize(*targets) @targets = targets end |
Instance Attribute Details
#targets ⇒ Object (readonly)
Returns the value of attribute targets.
3 4 5 |
# File 'lib/logz/multi_io.rb', line 3 def targets @targets end |
Instance Method Details
#close ⇒ Object
17 18 19 |
# File 'lib/logz/multi_io.rb', line 17 def close targets.each(&:close) end |
#flush ⇒ Object
13 14 15 |
# File 'lib/logz/multi_io.rb', line 13 def flush targets.each(&:flush) end |
#write(*args) ⇒ Object
9 10 11 |
# File 'lib/logz/multi_io.rb', line 9 def write(*args) targets.each {|t| t.write(*args); t.flush } end |