module Blobsterix::Http
Public Class Methods
NextApi(data="Not Found", content_type="txt")
click to toggle source
# File lib/blobsterix/helper/http.rb, line 33 def self.NextApi(data="Not Found", content_type="txt") Response(600, data, content_type) end
OK(data="", content_type="txt")
click to toggle source
# File lib/blobsterix/helper/http.rb, line 36 def self.OK(data="", content_type="txt") Response(200, data, content_type) end
OK_no_data(data="", content_type="txt")
click to toggle source
# File lib/blobsterix/helper/http.rb, line 42 def self.OK_no_data(data="", content_type="txt") [204, {}, ""] end
Response(status_code=200, data="", content_type="txt")
click to toggle source
# File lib/blobsterix/helper/http.rb, line 39 def self.Response(status_code=200, data="", content_type="txt") [status_code, {"Content-Type" => MimeMagic.by_extension(content_type).type}, data] end
error_massages()
click to toggle source
# File lib/blobsterix/helper/http.rb, line 23 def self.error_massages @error_massages||={"Not Found" => 404, "Server Error" => 500, "Not Allowed" => 403, "Not Authorized" => 401} end
error_object_binding(obj)
click to toggle source
# File lib/blobsterix/helper/http.rb, line 6 def self.error_object_binding(obj) obj||={} def obj.get_binding binding end def obj.title self[:title] end def obj.content self[:content] end def obj.error_code self[:error_code] end obj.get_binding end
renderer()
click to toggle source
# File lib/blobsterix/helper/http.rb, line 3 def self.renderer @@renderer||=TemplateRenderer.create(binding) end