Class: Request

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

Overview

Request class used as instance object of an incoming TCP request to manage that request. Splits the request into it’s method, resource, version, headers and params to be read by the router.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(input) ⇒ Request

Returns a new instance of Request.

Parameters:

  • input (String)

    the string of the request



6
7
8
# File 'lib/request.rb', line 6

def initialize(input)
    variable_definer(input)
end

Instance Attribute Details

#headersObject (readonly)

Returns the value of attribute headers.



3
4
5
# File 'lib/request.rb', line 3

def headers
  @headers
end

#methodObject (readonly)

Returns the value of attribute method.



3
4
5
# File 'lib/request.rb', line 3

def method
  @method
end

#paramsObject (readonly)

Returns the value of attribute params.



3
4
5
# File 'lib/request.rb', line 3

def params
  @params
end

#resourceObject (readonly)

Returns the value of attribute resource.



3
4
5
# File 'lib/request.rb', line 3

def resource
  @resource
end

#versionObject (readonly)

Returns the value of attribute version.



3
4
5
# File 'lib/request.rb', line 3

def version
  @version
end