@@ -141,7 +141,7 @@ def mount(mounts, *opts)
141141 # {hello: 'world'}
142142 # end
143143 # end
144- def route ( methods , paths = [ '/' ] , route_options = { } , &block )
144+ def route ( methods , paths = [ '/' ] , ** route_options , &block )
145145 method = methods == :any ? '*' : methods
146146 endpoint_params = inheritable_setting . namespace_stackable_with_hash ( :params ) || { }
147147 endpoint_description = inheritable_setting . route [ :description ]
@@ -156,7 +156,7 @@ def route(methods, paths = ['/'], route_options = {}, &block)
156156 route_options : all_route_options
157157 }
158158
159- new_endpoint = Grape ::Endpoint . new ( inheritable_setting , endpoint_options , &block )
159+ new_endpoint = Grape ::Endpoint . new ( inheritable_setting , ** endpoint_options , &block )
160160 endpoints << new_endpoint unless endpoints . any? { |e | e . equals? ( new_endpoint ) }
161161
162162 inheritable_setting . route_end
@@ -166,7 +166,7 @@ def route(methods, paths = ['/'], route_options = {}, &block)
166166 Grape ::HTTP_SUPPORTED_METHODS . each do |supported_method |
167167 define_method supported_method . downcase do |*args , **options , &block |
168168 paths = args . first || [ '/' ]
169- route ( supported_method , paths , options , &block )
169+ route ( supported_method , paths , ** options , &block )
170170 end
171171 end
172172
@@ -182,7 +182,7 @@ def route(methods, paths = ['/'], route_options = {}, &block)
182182 # # defines the endpoint: GET /foo/bar
183183 # end
184184 # end
185- def namespace ( space = nil , options = { } , &block )
185+ def namespace ( space = nil , ** options , &block )
186186 return Namespace . joined_space_path ( inheritable_setting . namespace_stackable [ :namespace ] ) unless space || block
187187
188188 within_namespace do
@@ -217,9 +217,7 @@ def reset_endpoints!
217217 #
218218 # @param param [Symbol] The name of the parameter you wish to declare.
219219 # @option options [Regexp] You may supply a regular expression that the declared parameter must meet.
220- def route_param ( param , options = { } , &block )
221- options = options . dup
222-
220+ def route_param ( param , **options , &block )
223221 options [ :requirements ] = {
224222 param . to_sym => options [ :requirements ]
225223 } if options [ :requirements ] . is_a? ( Regexp )
@@ -228,7 +226,7 @@ def route_param(param, options = {}, &block)
228226 requires param , type : options [ :type ]
229227 end if options . key? ( :type )
230228
231- namespace ( ":#{ param } " , options , &block )
229+ namespace ( ":#{ param } " , ** options , &block )
232230 end
233231
234232 # @return array of defined versions
0 commit comments