class Mitt::App

Public Class Methods

new(body) click to toggle source
# File lib/mitt/app.rb, line 2
def initialize(body)
  @body = body
end

Public Instance Methods

call(env) click to toggle source
# File lib/mitt/app.rb, line 6
def call(env)
  request = Rack::Request.new(env)

  puts "--- #{request.request_method} #{request.path} ---"
  request_body = request.body.read
  puts request_body unless request_body.empty?

  ['200', {'Content-Type' => 'text/html'}, [@body]]
end