Class: Cheffish::ChefRun::StringIOTee

Inherits:
StringIO
  • Object
show all
Defined in:
lib/cheffish/chef_run.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#streamsObject (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