Class: Pakyow::Rack::Connection

Inherits:
Connection show all
Defined in:
lib/pakyow/rack/compatibility.rb

Instance Attribute Summary

Attributes inherited from Connection

#body, #error, #headers, #id, #input_parser, #logger, #request, #status, #timestamp

Instance Method Summary collapse

Methods inherited from Connection

#authority, #close, #cookies, #delete_header, #endpoint, #finalize, #format, #format=, #header, #header?, #host, #input, #method, #params, #parsed_input, #path, #port, #scheme, #secure?, #set_header, #set_headers, #sleep, #stream, #streaming?, #subdomain, #type, #type_params, #update_request_cookie, #write

Constructor Details

#initialize(rack_env) ⇒ Connection

Returns a new instance of Connection.


11
12
13
# File 'lib/pakyow/rack/compatibility.rb', line 11

def initialize(rack_env)
  super(::Rack::Request.new(rack_env))
end

Instance Method Details

#fullpathObject


19
20
21
# File 'lib/pakyow/rack/compatibility.rb', line 19

def fullpath
  @request.fullpath
end

#hijack!Object


39
40
41
# File 'lib/pakyow/rack/compatibility.rb', line 39

def hijack!
  @request.env["rack.hijack"].call
end

#hijack?Boolean

Returns:

  • (Boolean)

35
36
37
# File 'lib/pakyow/rack/compatibility.rb', line 35

def hijack?
  @request.env["rack.hijack?"]
end

#ipObject


31
32
33
# File 'lib/pakyow/rack/compatibility.rb', line 31

def ip
  @request.ip
end

#queryObject


15
16
17
# File 'lib/pakyow/rack/compatibility.rb', line 15

def query
  @request.query_string
end

#request_header(key) ⇒ Object


23
24
25
# 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) ⇒ Boolean

Returns:

  • (Boolean)

27
28
29
# File 'lib/pakyow/rack/compatibility.rb', line 27

def request_header?(key)
  @request.has_header?(normalize_header(key))
end

#request_methodObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


44
45
46
# File 'lib/pakyow/rack/compatibility.rb', line 44

def request_method
  @request.request_method
end

#request_pathObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


49
50
51
# File 'lib/pakyow/rack/compatibility.rb', line 49

def request_path
  @request.fullpath
end