class Pakyow::Rack::Connection

Public Class Methods

new(rack_env) click to toggle source
Calls superclass method Pakyow::Connection::new
# File lib/pakyow/rack/compatibility.rb, line 11
def initialize(rack_env)
  super(::Rack::Request.new(rack_env))
end

Public Instance Methods

fullpath() click to toggle source
# File lib/pakyow/rack/compatibility.rb, line 19
def fullpath
  @request.fullpath
end
hijack!() click to toggle source
# File lib/pakyow/rack/compatibility.rb, line 39
def hijack!
  @request.env["rack.hijack"].call
end
hijack?() click to toggle source
# File lib/pakyow/rack/compatibility.rb, line 35
def hijack?
  @request.env["rack.hijack?"]
end
ip() click to toggle source
# File lib/pakyow/rack/compatibility.rb, line 31
def ip
  @request.ip
end
query() click to toggle source
# File lib/pakyow/rack/compatibility.rb, line 15
def query
  @request.query_string
end
request_header(key) click to toggle source
# File lib/pakyow/rack/compatibility.rb, line 23
def request_header(key)
  normalize_header_key_value(key, @request.get_header(normalize_header(key)))
end
request_header?(key) click to toggle source
# File lib/pakyow/rack/compatibility.rb, line 27
def request_header?(key)
  @request.has_header?(normalize_header(key))
end
request_method() click to toggle source

@api private

# File lib/pakyow/rack/compatibility.rb, line 44
def request_method
  @request.request_method
end
request_path() click to toggle source

@api private

# File lib/pakyow/rack/compatibility.rb, line 49
def request_path
  @request.fullpath
end

Private Instance Methods

normalize_header(key) click to toggle source
# File lib/pakyow/rack/compatibility.rb, line 55
def normalize_header(key)
  key.to_s.upcase.gsub("-", "_")
end
normalize_header_key_value(key, value) click to toggle source
# File lib/pakyow/rack/compatibility.rb, line 59
def normalize_header_key_value(key, value)
  if value && policy = Protocol::HTTP::Headers::MERGE_POLICY[key.to_s.downcase.gsub("_", "-")]
    policy.new(value.to_s)
  else
    value
  end
end