Class: Bane::Behaviors::Responders::DelugeResponse
- Inherits:
-
Object
- Object
- Bane::Behaviors::Responders::DelugeResponse
- 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
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ DelugeResponse
constructor
A new instance of DelugeResponse.
- #serve(io) ⇒ Object
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 = {length: 1_000_000}.merge() 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 |