class Rack::SinglePageApp::Base

The base Rack application which sends default HTML content.

Public Class Methods

new(content) click to toggle source

@param content [String] Response body content

# File lib/rack/single_page_app.rb, line 15
def initialize(content)
  @content = content
  @length = @content.size.to_s
end

Public Instance Methods

call(env) click to toggle source
# File lib/rack/single_page_app.rb, line 20
def call(env)
  [200, {'Content-Type' => 'text/html', 'Content-Length' => @length}, [@content]]
end