Class: Reel::Request::Info

Inherits:
Object
  • Object
show all
Defined in:
lib/reel/request/info.rb

Constant Summary collapse

UPGRADE =
'Upgrade'.freeze
WEBSOCKET =
'websocket'.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(http_method, url, http_version, headers) ⇒ Info

Returns a new instance of Info.



6
7
8
9
10
11
# File 'lib/reel/request/info.rb', line 6

def initialize(http_method, url, http_version, headers)
  @http_method  = http_method
  @url          = url
  @http_version = http_version
  @headers      = headers
end

Instance Attribute Details

#headersObject (readonly)

Returns the value of attribute headers.



4
5
6
# File 'lib/reel/request/info.rb', line 4

def headers
  @headers
end

#http_methodObject (readonly)

Returns the value of attribute http_method.



4
5
6
# File 'lib/reel/request/info.rb', line 4

def http_method
  @http_method
end

#http_versionObject (readonly)

Returns the value of attribute http_version.



4
5
6
# File 'lib/reel/request/info.rb', line 4

def http_version
  @http_version
end

#urlObject (readonly)

Returns the value of attribute url.



4
5
6
# File 'lib/reel/request/info.rb', line 4

def url
  @url
end

Instance Method Details

#websocket_request?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/reel/request/info.rb', line 16

def websocket_request?
  headers[UPGRADE] && headers[UPGRADE].downcase == WEBSOCKET
end