Class: SidekiqAlive::Server::HttpServer::Request
- Inherits:
-
Object
- Object
- SidekiqAlive::Server::HttpServer::Request
- Defined in:
- lib/sidekiq_alive/server/http_server.rb
Overview
Request class for HTTP server
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#header ⇒ Object
readonly
Returns the value of attribute header.
-
#method ⇒ Object
readonly
Returns the value of attribute method.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#proto ⇒ Object
readonly
Returns the value of attribute proto.
Instance Method Summary collapse
- #content_length ⇒ Object
-
#initialize(data, method = nil, path = nil, proto = nil) ⇒ Request
constructor
A new instance of Request.
Constructor Details
#initialize(data, method = nil, path = nil, proto = nil) ⇒ Request
Returns a new instance of Request.
15 16 17 18 19 20 21 |
# File 'lib/sidekiq_alive/server/http_server.rb', line 15 def initialize(data, method = nil, path = nil, proto = nil) @header = {} @data = data @method = method @path = path @proto = proto end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
13 14 15 |
# File 'lib/sidekiq_alive/server/http_server.rb', line 13 def data @data end |
#header ⇒ Object (readonly)
Returns the value of attribute header.
13 14 15 |
# File 'lib/sidekiq_alive/server/http_server.rb', line 13 def header @header end |
#method ⇒ Object (readonly)
Returns the value of attribute method.
13 14 15 |
# File 'lib/sidekiq_alive/server/http_server.rb', line 13 def method @method end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
13 14 15 |
# File 'lib/sidekiq_alive/server/http_server.rb', line 13 def path @path end |
#proto ⇒ Object (readonly)
Returns the value of attribute proto.
13 14 15 |
# File 'lib/sidekiq_alive/server/http_server.rb', line 13 def proto @proto end |
Instance Method Details
#content_length ⇒ Object
23 24 25 26 27 28 |
# File 'lib/sidekiq_alive/server/http_server.rb', line 23 def content_length len = @header["Content-Length"] return if len.nil? len.to_i end |