Class: Bane::Behaviors::Responders::DelugeResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/bane/behaviors/responders/deluge_response.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

Constructor Details

#initialize(options = {}) ⇒ DelugeResponse

Returns a new instance of DelugeResponse.



12
13
14
# File 'lib/bane/behaviors/responders/deluge_response.rb', line 12

def initialize(options = {})
  @options = {length: 1_000_000}.merge(options)
end

Instance Method Details

#serve(io) ⇒ Object



16
17
18
19
20
# File 'lib/bane/behaviors/responders/deluge_response.rb', line 16

def serve(io)
  length = @options[:length]

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