Class: Server::LoremPath

Inherits:
WEBrick::HTTPServlet::AbstractServlet
  • Object
show all
Defined in:
lib/server.rb

Instance Method Summary collapse

Instance Method Details

#do_GET(request, response) ⇒ Object



22
23
24
25
26
27
# File 'lib/server.rb', line 22

def do_GET(request, response)
  length = request.query['length'].to_i
  length = -1 if length < 1
  response.body = Server::LoremIpsum.lorem[0..length]
  response.status = 200
end