Class: Switchman::Parallel::TransformingIO

Inherits:
Object
  • Object
show all
Defined in:
lib/switchman/parallel.rb

Instance Method Summary collapse

Constructor Details

#initialize(transformer, original_io) ⇒ TransformingIO

Returns a new instance of TransformingIO.



56
57
58
59
# File 'lib/switchman/parallel.rb', line 56

def initialize(transformer, original_io)
  @transformer = transformer
  @original_io = original_io
end

Instance Method Details

#puts(*args) ⇒ Object



61
62
63
# File 'lib/switchman/parallel.rb', line 61

def puts(*args)
  args.flatten.each { |arg| @original_io.puts @transformer.call(arg) }
end