class Wiris::HttpResponse

Public Class Methods

new(actionController) click to toggle source
# File lib/src-generic/HttpResponse.rb, line 46
def initialize(actionController)
        @closed=false
        @actionController = actionController
        @writing=false
        @out = ""
        @res = actionController.response
        @headers = Hash.new()
end

Public Instance Methods

actionController() click to toggle source
# File lib/src-generic/HttpResponse.rb, line 3
def actionController
        @actionController
end
actionController=(actionController) click to toggle source
# File lib/src-generic/HttpResponse.rb, line 7
def actionController=(actionController)
        @actionController=actionController
end
close() click to toggle source
# File lib/src-generic/HttpResponse.rb, line 64
def close
        @res.close
        if @writing
                actionController.render :text => @out
        end
end
getHeader(name) click to toggle source
# File lib/src-generic/HttpResponse.rb, line 60
def getHeader(name)
        return @headers.get(name)
end
headers() click to toggle source
# File lib/src-generic/HttpResponse.rb, line 17
def headers
        @headers
end
headers=(headers) click to toggle source
# File lib/src-generic/HttpResponse.rb, line 13
def headers=(headers)
        @headers = headers
end
out() click to toggle source
# File lib/src-generic/HttpResponse.rb, line 25
def out
        @out
end
out=(out) click to toggle source
# File lib/src-generic/HttpResponse.rb, line 21
def out=(out)
        @out=out
end
res() click to toggle source
# File lib/src-generic/HttpResponse.rb, line 10
def res
        @res
end
setHeader(name, value) click to toggle source
# File lib/src-generic/HttpResponse.rb, line 55
def setHeader(name, value)
        @headers.set(name, value)
        @res.headers[name] = value
end
writeBinary(data) click to toggle source
# File lib/src-generic/HttpResponse.rb, line 42
def writeBinary(data)
        writeString(data.toString())
end
writeString(s) click to toggle source
# File lib/src-generic/HttpResponse.rb, line 37
def writeString(s)
        @writing = true
        @out = @out + s
end
writing() click to toggle source
# File lib/src-generic/HttpResponse.rb, line 29
def writing
        @writing
end
writing=(writing) click to toggle source
# File lib/src-generic/HttpResponse.rb, line 33
def writing=(writing)
        @writing=writing
end