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.
3 4 5 |
# File 'lib/proxy_logger.rb', line 3 def initialize(*targets) @targets = targets.flatten end |
Instance Attribute Details
#targets ⇒ Object (readonly)
Returns the value of attribute targets.
2 3 4 |
# File 'lib/proxy_logger.rb', line 2 def targets @targets end |
Instance Method Details
#close ⇒ Object
13 14 15 |
# File 'lib/proxy_logger.rb', line 13 def close @targets.each(&:close) end |
#write(*args) ⇒ Object
7 8 9 10 11 |
# File 'lib/proxy_logger.rb', line 7 def write(*args) @targets.each do |t| t.write(*args) end end |