-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Explicit return calls do not raise LocalJumpError
Instead of calling instance_eval on the block passed into Endpoint#initialize, create an anonymous UnboundMethod with the block as the method body. When executing the block bind the instance of Endpoint to the UnboundMethod and call it. This behavior and solution is taken from Sinatra. This solution also makes it possible to pass the values of Endpoint#params as arguments to the block. That feature is not present in this commit, but is trivial to implement.
- Loading branch information
Showing
3 changed files
with
59 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters