Module: Bane::Behaviors::Responders::ForEachLine

Included in:
DelugeResponseForEachLine, FixedResponseForEachLine, NewlineResponseForEachLine, RandomResponseForEachLine, SlowResponseForEachLine
Defined in:
lib/bane/behaviors/responders/for_each_line.rb

Overview

This module can be used to wrap another behavior with a “while(io.gets)” loop, which reads a line from the input and then performs the given behavior.

Instance Method Summary collapse

Instance Method Details

#serve(io) ⇒ Object



9
10
11
12
13
# File 'lib/bane/behaviors/responders/for_each_line.rb', line 9

def serve(io)
  while (io.gets)
    super(io)
  end
end