Class: NetMate::Response
- Inherits:
-
Object
- Object
- NetMate::Response
- Defined in:
- lib/net_mate/response.rb
Instance Method Summary collapse
- #error ⇒ Object
-
#initialize(body) ⇒ Response
constructor
A new instance of Response.
- #respond ⇒ Object
Constructor Details
#initialize(body) ⇒ Response
Returns a new instance of Response.
4 5 6 |
# File 'lib/net_mate/response.rb', line 4 def initialize body @body = body end |
Instance Method Details
#error ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/net_mate/response.rb', line 16 def error Rack::Response.new.finish do |res| res['Content-Type'] = 'text/html' res.status = 404 res.write @body end end |
#respond ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/net_mate/response.rb', line 8 def respond Rack::Response.new.finish do |res| res['Content-Type'] = 'text/html' res.status = 200 res.write @body end end |