Class: ProxyLogger
- Inherits:
-
Object
- Object
- ProxyLogger
- Defined in:
- lib/proxy_logger.rb
Instance Attribute Summary collapse
-
#targets ⇒ Object
readonly
Returns the value of attribute targets.
Instance Method Summary collapse
- #close ⇒ Object
-
#initialize(*targets) ⇒ ProxyLogger
constructor
A new instance of ProxyLogger.
- #write(*args) ⇒ Object
Constructor Details
#initialize(*targets) ⇒ ProxyLogger
Returns a new instance of ProxyLogger.
5 6 7 |
# File 'lib/proxy_logger.rb', line 5 def initialize(*targets) @targets = targets.flatten end |
Instance Attribute Details
#targets ⇒ Object (readonly)
Returns the value of attribute targets.
4 5 6 |
# File 'lib/proxy_logger.rb', line 4 def targets @targets end |
Instance Method Details
#close ⇒ Object
15 16 17 |
# File 'lib/proxy_logger.rb', line 15 def close @targets.each(&:close) end |
#write(*args) ⇒ Object
9 10 11 12 13 |
# File 'lib/proxy_logger.rb', line 9 def write(*args) @targets.each do |t| t.write(*args) end end |