class RSence::Request
Simple Request
class, slightly more involved than the Rack::Request it’s extending.
Attributes
header[R]
path[R]
query[R]
Public Class Methods
new(env)
click to toggle source
Calls superclass method
# File lib/rsence/http/request.rb, line 13 def initialize(env) @header = RequestHeader.new super env2header() @path = path_info() @query = params() end
Public Instance Methods
env2header()
click to toggle source
# File lib/rsence/http/request.rb, line 35 def env2header @env.each do |env_key,env_val| if @@env_transl.has_key?(env_key) http_key = @@env_transl[env_key] @header[http_key] = @env[env_key] elsif env_key.start_with?( 'HTTP_' ) http_key = env_key[4..-1].gsub(/_([A-Z0-9]+)/) {|m|'-'+$1.downcase}[1..-1] @header[http_key] = @env[env_key] end end end
unparsed_uri()
click to toggle source
# File lib/rsence/http/request.rb, line 20 def unparsed_uri return @header['request-uri'] end