Class: Bane::Behaviors::DelugeResponse

Inherits:
BasicBehavior show all
Defined in:
lib/bane/behaviors.rb

Overview

Sends a large response. Response consists of a repeated ‘x’ character.

Options

- length: The size in bytes of the response to send. Default: 1,000,000 bytes

Direct Known Subclasses

DelugeResponseForEachLine

Instance Method Summary collapse

Methods inherited from BasicBehavior

inherited, simple_name

Instance Method Details

#serve(io, options) ⇒ Object



124
125
126
127
128
129
# File 'lib/bane/behaviors.rb', line 124

def serve(io, options)
  options = {:length => 1_000_000}.merge(options)
  length = options[:length]

  length.times { io.write('x') }
end