Skip to content
This repository was archived by the owner on May 1, 2018. It is now read-only.

hw1\hw2#36

Open
A-Lada wants to merge 2 commits into
denysxftr:masterfrom
A-Lada:master
Open

hw1\hw2#36
A-Lada wants to merge 2 commits into
denysxftr:masterfrom
A-Lada:master

Conversation

@A-Lada
Copy link
Copy Markdown

@A-Lada A-Lada commented Nov 15, 2016

No description provided.

Copy link
Copy Markdown
Owner

@denysxftr denysxftr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure that i understand purpose of @reserved_words but it looks like your code is hardcoded a bit

Comment thread hw2/lib/router.rb
def call(env)
res = detect_route(env['REQUEST_METHOD'], env['REQUEST_PATH'])
if (!res || res.empty?)
then
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you don't need then

Comment thread hw2/lib/router.rb
then
[404, {}, ['page not found']]
else
env['REQUEST_PATH'] = res
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do you assign res to env['REQUEST_PATH'] ?
you can just @routes[env['REQUEST_METHOD']][res].call(env)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants