Class: Sharp::Logging::MultiIO
- Inherits:
-
Object
- Object
- Sharp::Logging::MultiIO
- Defined in:
- lib/sharp/logging.rb
Overview
Instance Method Summary collapse
- #add_target(target) ⇒ Object
- #close ⇒ Object
-
#initialize(*targets) ⇒ MultiIO
constructor
A new instance of MultiIO.
- #write(*args) ⇒ Object
Constructor Details
#initialize(*targets) ⇒ MultiIO
Returns a new instance of MultiIO.
6 7 8 |
# File 'lib/sharp/logging.rb', line 6 def initialize(*targets) @targets = targets end |
Instance Method Details
#add_target(target) ⇒ Object
10 11 12 |
# File 'lib/sharp/logging.rb', line 10 def add_target(target) @targets << target end |
#close ⇒ Object
18 19 20 |
# File 'lib/sharp/logging.rb', line 18 def close @targets.each(&:close) end |
#write(*args) ⇒ Object
14 15 16 |
# File 'lib/sharp/logging.rb', line 14 def write(*args) @targets.each {|t| t.write(*args)} end |