class NetMate::Response

Public Class Methods

new(body) click to toggle source
# File lib/net_mate/response.rb, line 4
def initialize body
  @body = body
end

Public Instance Methods

error() click to toggle source
# 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() click to toggle source
# 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