Skip to content

Commit

Permalink
Merge pull request #1750 from dentarg/fix-delegation
Browse files Browse the repository at this point in the history
Use `ruby2_keywords` for delegation
  • Loading branch information
jkowens committed Feb 21, 2022
2 parents ea6c216 + e814c6f commit 51ff33a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/sinatra/base.rb
Expand Up @@ -1529,10 +1529,11 @@ def prototype
# Create a new instance of the class fronted by its middleware
# pipeline. The object is guaranteed to respond to #call but may not be
# an instance of the class new was called on.
def new(*args, **kwargs, &bk)
instance = new!(*args, **kwargs, &bk)
def new(*args, &bk)
instance = new!(*args, &bk)
Wrapper.new(build(instance).to_app, instance)
end
ruby2_keywords :new if respond_to?(:ruby2_keywords, true)

# Creates a Rack::Builder instance with all the middleware set up and
# the given +app+ as end point.
Expand Down

0 comments on commit 51ff33a

Please sign in to comment.