Class: Cheffish::ChefRun::StringIOTee
- Inherits:
-
StringIO
- Object
- StringIO
- Cheffish::ChefRun::StringIOTee
- Defined in:
- lib/cheffish/chef_run.rb
Instance Attribute Summary collapse
-
#streams ⇒ Object
readonly
Returns the value of attribute streams.
Instance Method Summary collapse
-
#initialize(*streams) ⇒ StringIOTee
constructor
A new instance of StringIOTee.
- #write(*args, &block) ⇒ Object
Constructor Details
#initialize(*streams) ⇒ StringIOTee
Returns a new instance of StringIOTee.
21 22 23 24 |
# File 'lib/cheffish/chef_run.rb', line 21 def initialize(*streams) super() @streams = streams.flatten.select { |s| !s.nil? } end |
Instance Attribute Details
#streams ⇒ Object (readonly)
Returns the value of attribute streams.
26 27 28 |
# File 'lib/cheffish/chef_run.rb', line 26 def streams @streams end |
Instance Method Details
#write(*args, &block) ⇒ Object
28 29 30 31 |
# File 'lib/cheffish/chef_run.rb', line 28 def write(*args, &block) super streams.each { |s| s.write(*args, &block) } end |