Class: Rigrate::MutiOutput
- Inherits:
-
Object
- Object
- Rigrate::MutiOutput
- Defined in:
- lib/rigrate.rb
Overview
used to output logger to mutli place
Instance Method Summary collapse
- #close ⇒ Object
-
#initialize(file, prompt) ⇒ MutiOutput
constructor
A new instance of MutiOutput.
- #write(*args) ⇒ Object
Constructor Details
#initialize(file, prompt) ⇒ MutiOutput
Returns a new instance of MutiOutput.
17 18 19 20 21 |
# File 'lib/rigrate.rb', line 17 def initialize(file, prompt) @target = [] @target << file @target << STDOUT if prompt end |
Instance Method Details
#close ⇒ Object
27 28 29 |
# File 'lib/rigrate.rb', line 27 def close @target.each(&:close) end |
#write(*args) ⇒ Object
23 24 25 |
# File 'lib/rigrate.rb', line 23 def write(*args) @target.each { |dest| dest.write(*args) } end |