Class: Redwing::Logger::MultiIO
- Inherits:
-
Object
- Object
- Redwing::Logger::MultiIO
- Defined in:
- lib/redwing/logger.rb
Instance Method Summary collapse
- #close ⇒ Object
- #flush ⇒ Object
-
#initialize(*targets) ⇒ MultiIO
constructor
A new instance of MultiIO.
- #write ⇒ Object
Constructor Details
#initialize(*targets) ⇒ MultiIO
Returns a new instance of MultiIO.
43 44 45 |
# File 'lib/redwing/logger.rb', line 43 def initialize(*targets) @targets = targets end |
Instance Method Details
#close ⇒ Object
55 56 57 |
# File 'lib/redwing/logger.rb', line 55 def close @targets.each(&:close) end |
#flush ⇒ Object
51 52 53 |
# File 'lib/redwing/logger.rb', line 51 def flush @targets.each { |t| t.flush if t.respond_to?(:flush) } end |
#write ⇒ Object
47 48 49 |
# File 'lib/redwing/logger.rb', line 47 def write(*) @targets.each { |t| t.write(*) } end |