Class: Console::Output::Split
- Inherits:
-
Object
- Object
- Console::Output::Split
- Defined in:
- lib/console/output/split.rb
Overview
Split output into multiple outputs.
Class Method Summary collapse
-
.[](*outputs) ⇒ Object
Create a new split output.
Instance Method Summary collapse
-
#call ⇒ Object
Invoke the outputs.
-
#initialize(outputs) ⇒ Split
constructor
Create a new split output.
-
#verbose!(value = true) ⇒ Object
Set the verbose flag for all outputs.
Constructor Details
#initialize(outputs) ⇒ Split
Create a new split output.
20 21 22 |
# File 'lib/console/output/split.rb', line 20 def initialize(outputs) @outputs = outputs end |
Class Method Details
.[](*outputs) ⇒ Object
Create a new split output.
13 14 15 |
# File 'lib/console/output/split.rb', line 13 def self.[](*outputs) self.new(outputs) end |
Instance Method Details
#call ⇒ Object
Invoke the outputs. If a block is used, it may be invoked multiple times.
32 33 34 35 36 |
# File 'lib/console/output/split.rb', line 32 def call(...) @outputs.each do |output| output.call(...) end end |
#verbose!(value = true) ⇒ Object
Set the verbose flag for all outputs.
27 28 29 |
# File 'lib/console/output/split.rb', line 27 def verbose!(value = true) @outputs.each{|output| output.verbose!(value)} end |