Class: Bane::Behaviors::Responders::FixedResponse
- Inherits:
-
Object
- Object
- Bane::Behaviors::Responders::FixedResponse
- Defined in:
- lib/bane/behaviors/responders/fixed_response.rb
Overview
Sends a static response.
Options:
- message: The response message to send. Default: "Hello, world!"
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ FixedResponse
constructor
A new instance of FixedResponse.
- #serve(io) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ FixedResponse
Returns a new instance of FixedResponse.
12 13 14 |
# File 'lib/bane/behaviors/responders/fixed_response.rb', line 12 def initialize( = {}) @options = {message: "Hello, world!"}.merge() end |
Instance Method Details
#serve(io) ⇒ Object
16 17 18 |
# File 'lib/bane/behaviors/responders/fixed_response.rb', line 16 def serve(io) io.write @options[:message] end |