-
-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Moving params in to HTTP::Server::Context #1509
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,4 +24,10 @@ class HTTP::Server::Context | |
def flash : Lucky::FlashStore | ||
@_flash ||= Lucky::FlashStore.from_session(session) | ||
end | ||
|
||
@_params : Lucky::Params? | ||
|
||
def params : Lucky::Params | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Side bonus, |
||
@_params ||= Lucky::Params.new(request) | ||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
module Lucky::ParamHelpers | ||
@_params : Lucky::Params? | ||
|
||
def params : Lucky::Params | ||
@_params ||= Lucky::Params.new(context.request, @route_params) | ||
memoize def params : Lucky::Params | ||
context.params | ||
end | ||
Comment on lines
+2
to
4
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is basically just so you can still call |
||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It feels weird putting this here, but where else would it go?