class Rack::Anystatus::Endpoint

Constants

F

Public Class Methods

new(status_code, path) click to toggle source
# File lib/rack/anystatus/endpoint.rb, line 5
def initialize(status_code, path)
    file = F.expand_path path
    @content = F.read file
    @length = @content.length.to_s
    @status_code = status_code
end

Public Instance Methods

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