Finished routing, simple website now works yay
This commit is contained in:
parent
12653f6f48
commit
7a112697ec
11 changed files with 148 additions and 15 deletions
|
|
@ -2,14 +2,13 @@ class Request
|
|||
attr_reader :method, :resource, :version, :headers, :params
|
||||
|
||||
def initialize(input)
|
||||
@input = input
|
||||
variable_definer(@input)
|
||||
variable_definer(input)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def variable_definer(input) ##Defines required class variables by splitting up the input text
|
||||
rows = input.split(/\n/)
|
||||
rows = input.split(/\r\n/)
|
||||
@method, @resource, @version = rows[0].split(' ')
|
||||
@headers, @params = {}, {}
|
||||
if rows.find_index("") != nil then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue